As a sidenote on the topic, is there any skeleton implementations of dispatcher-based actor code?
I'm doing some testing and could surely use some demo-code. (No re-inventing of the round thing used for transportation of stuff)
Best regards
/Viktor
On 9/25/07, Martin Probst <mail@...> wrote:
> 1) java.util.regex.Matcher is not thread-safe, so you'll likely run into
> problems if you use it in different actors unless you make it
> actor-specific
I'm aware of that, I only share the pattern between Actors. Also, you have
to create a new matcher for each line anyways.
> 2) when sending a message to an actor, the processing happens in the same
> thread unless/until the actor blocks, in which case the thread is
released
> and the caller/callee are disjoined. (My understanding is this is a
> [default] optimization to balance fine/coarse-grained processing to avoid
> costly context-switches)
What exactly is blocking in this context? Waiting for another message send?
As said, my code uses a coordinator that dispatches work to multiple
actors. That might be executed in a single thread, as it dispatches the
work one after the other, and actors simply run through the work, so there
is no complex message sending that might block actors.
Martin