I not开发者_如何转开发iced that Actor
reply invokes the reply
method of a thread local variable of ReplyReactor
type (see private methodrawSelf
). This reply
method sends a message to the senders.head
, where the senders
is a list of senders (see the source).
Now I wonder if it may cause a bug. What if two actors share one thread with a thread local ReplyReactor
instance ? Is there a scenario, when one of the actors replies to a wrong sender ?
Actors do share threads, but they cannot be interrupted. They'll run until the next react
or end of loop
, at which point they cannot reply
anymore, before doing another react
or receive
.
精彩评论