daydreamer
daydreamer

Reputation: 91949

Relationship between akka Actor and Java Thread?

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

I am confused with it now

Upvotes: 1

Views: 542

Answers (1)

Quizzie
Quizzie

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

Related Questions