3.2 Thread Scheduling and Blocking Restrictions

CONVERSE threads use a scheduler queue, like any other threads package. We chose to use the same queue as the one used for CONVERSE messages (see section 2.9). Because of this, thread context-switching will not work unless there is a thread polling for messages. A rule of thumb, with CONVERSE, it is best to have a thread polling for messages at all times. In CONVERSE's normal mode (see section 1), this happens automatically. However, in user-calls-scheduler mode, you must be aware of it.

There is a second caution associated with this design. There is a thread polling for messages (even in normal mode, it's just hidden in normal mode). The continuation of your computation depends on that thread -- you must not block it. In particular, you must not call blocking operations in these places:

These restrictions are usually easy to avoid. For example, if you wanted to use a blocking operation inside a CONVERSE handler, you would restructure the code so that the handler just creates a new thread and returns. The newly-created thread would then do the work that the handler originally did.

October 08, 2008
Converse Homepage
Charm Homepage