Selective Receive Message Passing Example

This applet demonstrates the use of selective receive. It is a re-implementation of the Carpark example using message passing. The arrivals and departures threads communicate with the thread controlling the carpark using message passing. The carpark thread rotates once for each message it receives, whether from the departures thread or the arrivals thread. The effect of the select can clearly be seen by running the departures and arrivals threads first and then running the carpark controller thread.

Channel.java

Select.java

Selectable.java

SelectMsgDemo.java