[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

The 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 procedure named by term in the new thread context. This procedure can access the visible objects in the spawning thread; the two threads share common memory. Threads are preemptively scheduled. The Limbo language provides no explicit synchronization primitives; Monitors shows examples of how to use channel communication to control concurrence. Returning from the spawned procedure is equivalent to an exit statement.



[Contents]
[Prev] [Next] [Limbo Basics] [Limbo Programming] [Language Definition]

Copyright © 1998, Lucent Technologies, Inc. All rights reserved.