Implementing choice in Java
Implementing choice in Java
We use a Select class which can be used to choose between communication input on a set of channels. Output communication choice is not supported. The general schema for (ch1?v ® P(v) ) (ch2?u ® R(u)) is:
If neither channel ch1 or ch2 is ready then the thread executing this code is blocked. If a choice is repeatedly made then the select object need only be initialised once with the potential choices.