Category: Database

The Ballerina programming language has a unique concurrency model that promotes efficient resource usage and provides an intuitive programming model for users. In this article, we will take an in-depth look into Ballerina’s concurrency support, and see how the non-blocking I/O operations are implemented on top of this.

This is somewhat of an expensive operation since the current thread’s full state needs to be stored in memory, and the other thread’s earlier stored state has to be read in and restored to start its execution.

In this invocation, the current worker in the main function is suspended, and its strand moves into executing the default worker of the printNumber function.

In this execution, the strand of the default worker of the function process creates new strands for the execution of workers w1 and w2.

Related Articles