DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

Ballerina Concurrency Model and Non-Blocking I/O

4 years ago medium.com
Ballerina Concurrency Model and Non-Blocking I/O

Summary: This is a summary of an article originally published by the source. Read the full original article here →

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.

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com