Concurrency: `ForkJoinPoolScheduler#schedule(..)` can intermittently lose messages
SereneAnt opened this issue · comments
iAnt commented
In ForkJoinPoolScheduler#schedule(..)
, an actor can intermittently skip messages.
Possible scenarios (others possible):
1.
- The single actr created;
- Thread A adds a runnable to the actr's mailbox;
- Thread A locks the mailbox and runs the runnable;
- Thread B adds a runnable, the actor's mailbox is still locked, so the 'runnable.run()' is skipped.
- Thread A unlocks the mailbox;
- The single actr created;
- Thread A adds a runnable to the actr's mailbox;
- Thread A locks the malebox and runs the runnable;
- Thread B adds a runnable to the same mailbox;
- Thread A removes the last runnable (from thread B) without execution.
The result: The message (runnable) from thread B is lost.
Oleksandr Zakusylo commented
Fixed in actr 0.1.0