Copyright © 1996, 1997 Lucent Technologies Inc. All rights reserved.

9.12 spawn statement

The spawn statement creates a new thread of control. It has the form


spawn term ( expression-listopt ) ;
The term and expression-list are taken to be a function call. Execution of spawn creates an asynchronous, independent thread of control, which calls the function in the new thread context. This function may access the accessible objects in the spawning thread; the two threads share a common memory space. These accessible objects include the data global to the current module and reference data passed to the spawned function. Threads are preemptively scheduled, so that changes to objects used in common between threads may occur at any time. The Limbo language provides no explicit synchronization primitives; §12.3 shows examples of how to use channel communication to control concurrency.

05/Jun/97