On Mon, Nov 9, 2015 at 5:23 PM, Kostas kougios <
[email protected]> wrote:

> I have some code that will take some time to execute. This code runs in a
> few steps with each step "blocking" for some time to store data into files.
>
> I am thinking in creating a new actor which can receive 1 message for each
> step. Will the block part affect only that actor or will other actors be
> affected (since threads are reused in the actorsystem)?
>

The block doesn't necessarily affect any *specific* other Actor -- each
Actor is threaded separately.  However, if you do this a lot, especially
with multiple Actors doing it, you can easily starve the thread pool: all
of the available threads are blocked, so there's nothing left to allocate
to other Actors.

The usual recommendation, if you need to do a bunch of blocking, is to assign
the blocking Actors to their own dedicated Dispatcher
<http://stackoverflow.com/questions/19944034/blocking-calls-in-akka-actors>;
that will leave the default dispatcher available to deal with non-blocking
Actors...

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to