Category:Smalltalk: Difference between revisions

Line 558:
 
=== 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 ] forkAt: priorityLevel</lang>
1) 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