Category:Smalltalk: Difference between revisions

m
Line 430:
=== Multithreading ===
New threads are started by sending 'fork' to a block; this will create a process instance which executes the block's code in a separate thread (within the same address space):
<lang smalltalk>[ do something ] fork.
[ do something ] fork.
 
[ do something ] forkAt: priorityLevel</lang>
</lang>
Notice that these are technically threads, not "unix processes". They execute in the same address (or object-) space.
They are named "Process" and created with "fork" in Smalltalk for historic reasons.
Anonymous user