Reputation: 91949
I am trying to get my head around Akka and onething which I am not able to visualize is the relation between Java Threads to Akka Actors
1:1
?1:many
?I am confused with it now
Upvotes: 1
Views: 542
Reputation: 879
Akka actors (usually) do not have a fixed thread assigned to them. Threads are assigned to messages.
The dispatcher assigns threads to messages which are polled from the mailbox. He decides when each actor can start processing a message. When the actor has an empty mailbox, he owns no thread. The number of threads per dispatcher is configurable.
Though there is a dispatcher called the "pinned dispatcher", which gives one fixed thread to each actor, it is rarely used.
Upvotes: 3