Ada’s select statement allows you to wait on multiple entry calls. Combining tasks and entries with select is a powerful feature of Ada.
To run the program, save it as select_example.adb and use the following commands:
We receive the values “one” and then “two” as expected.
Note that the total execution time is only ~2 seconds since both the 1 and 2 second delays execute concurrently.
In this Ada version, we use tasks instead of goroutines, and entries instead of channels. The select statement in Ada allows us to wait on multiple entry calls, similar to Go’s select statement waiting on multiple channel operations. The structure and behavior of the program remain similar to the original Go version, demonstrating Ada’s concurrent programming capabilities.