zakgof / actr

Simple, fast and typesafe Java actor model implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

SereneAnt opened this issue · comments

commented

In ForkJoinPoolScheduler#schedule(..), an actor can intermittently duplicate messages.

A possible scenario (one of ?):

  • 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 to the same mailbox;
  • Thread A removes the last runnable from thread B (which is lost !!!);
  • The mailbox is still not empty, so the first runnable is executed again;

Fixed in actr 0.1.0