Concurrency-Safe Execution Using Ballerina Isolation

The Ballerina language establishes a concurrent friendly approach to programming through light-weighted threads called strands. This is achieved by providing support for both preemptive and cooperative multitasking. When executing a concurrent program in a multi-threaded environment, the safe usage of shared resources is pivotal. This is obtained through a language concept called isolation. In this article, we will take an in-depth look at the concurrent safety support of Ballerina and see how HTTP services can be implemented to provide timely and accurate responses using isolation.

Race Condition in Concurrent Programming

In order to maintain the dynamic nature of a service, the following two aspects are considered during its implementation. 

Java Concurrency With Project Loom

Early Access: Java Concurrency With Project Loom

I am excited about Project Loom. The project focuses on easy to use lightweight concurrency for the JavaVM. Nowadays, the JavaVM provides a one java thread to one OS thread model to the programmer. While it's actually the current Oracle implementation, it used to be that many JavaVM versions ago, threads provided to the programmer were actually green threads.

Project Loom goes down that road again, providing lightweight threads to the programmer. Those lightweight threads are mapped to OS threads in a "many-to-many" relationship.