Araq/Nimrod — Issue #71: Actor pool "join" returns too early
Author: jeberger
Created: 2011-12-03 17:00:58+00:00
State: open

If one of the actions already running tries to send a new action to the pool after the main thread has called join, then the new actions may not get called.

import actors

var
a: TActorPool[int, void]
createActorPool(a)

proc task (i: int) {.thread.} =
echo i
if i != 0: a.spawn (i-1, task)

a.spawn (10, task)
a.join()

This code should print all numbers between 0 and 10 in no particular order, instead it only prints "10".