« Return to Thread: [scala] Scala Actors - no speedup?

Re: [scala] Scala Actors - no speedup?

by Martin Probst-2 :: Rate this Message:

Reply to Author | View in Thread

> 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

 « Return to Thread: [scala] Scala Actors - no speedup?