zakgof / actr

Simple, fast and typesafe Java actor model implementation
Apache License 2.0
119 stars 20 forks source link

Concurrency: `ForkJoinPoolScheduler#schedule(..)` can intermittently lose messages #6

Closed SereneAnt closed 5 years ago

SereneAnt commented 5 years ago

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 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.

zakgof commented 5 years ago

Fixed in actr 0.1.0