A process is normally created by sending the fork or forkAt: message to a block as shown in the following example. This process is immediately scheduled for execution. The fork message schedules the new process at the same priority as the process running the fork, while forkAt: allows the priority to be explicitly specified. When the new process runs, it evaluates the block. A reference to the new process can be retained by assigning it to an instance or temporary variable.A process can be created in a suspended state by sending the newProcess message to a block as shown in the next example. The new process is not scheduled for execution until it is sent the resume message.
|