Beginning Ballerina Programming by Anjana Fernando & Lakmal Warusawithana
Author:Anjana Fernando & Lakmal Warusawithana
Language: eng
Format: epub
ISBN: 9781484251393
Publisher: Apress
Let’s remove the comment from line 4 and line 29 and run the code.$ ballerina run workers_iteration2.bal
Worker execution started
Worker execution finished
w1: sum of first 10000000 positive numbers = 50000005000000
w2: sum of squares of first 10000000 positive numbers = 1291990006563070912
Now you can see that line 4 and line 29 executed and printed before the two workers print the sum of n and the sum of n squares. This is because if explicit workers are not mentioned within worker blocks, the function code will belong to a single unnamed default worker.
If you want to wait for both workers to get printed sums before line 29 gets printed, you can uncomment line 27, ( _ = wait {w1, w2}; ), which makes it wait before it executes.$ ballerina run workers_iteration2.bal
Worker execution started
w1: sum of first 10000000 positive numbers = 50000005000000
w2: sum of squares of first 10000000 positive numbers = 1291990006563070912
Worker execution finished
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Ada | Ajax |
Assembly Language Programming | Borland Delphi |
C & C++ | C# |
CSS | Compiler Design |
Compilers | DHTML |
Debugging | Delphi |
Fortran | Java |
Lisp | Perl |
Prolog | Python |
RPG | Ruby |
Swift | Visual Basic |
XHTML | XML |
XSL |
Hello! Python by Anthony Briggs(9924)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9800)
The Mikado Method by Ola Ellnestam Daniel Brolund(9784)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7787)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7770)
Grails in Action by Glen Smith Peter Ledbrook(7704)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7566)
Windows APT Warfare by Sheng-Hao Ma(6902)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6635)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6501)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6422)
Kotlin in Action by Dmitry Jemerov(5072)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4322)
Functional Programming in JavaScript by Mantyla Dan(4042)
Solidity Programming Essentials by Ritesh Modi(4042)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3833)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3773)
The Ultimate iOS Interview Playbook by Avi Tsadok(3750)
