Can Akka Actors be considered as green threads?

330 views
Skip to first unread message

kant kodali

unread,
Mar 31, 2017, 6:53:29 AM3/31/17
to Akka User List
Hi All,

I wonder what is an Actor underneath ? I mean I understand that they are Object that have a state, mailbox , listeners and all that but the moment I hear Actors can "crash" and "restart and run or process again" I think of it as some scheduling/processing entity and I wonder if that entity is a green thread that are eventually mapped to Kernel threads like the M:N model? 

The statement below says Actors "conceptually" have their own light weight thread. what does "conceptually" mean here? If they are not green threads can we simply say Actors are objects that are scheduled on Kernel threads using ForkJoin Pool?

http://doc.akka.io/docs/akka/current/general/actors.html "Akka actors conceptually each have their own light-weight thread"

Thanks!



Konrad Malawski

unread,
Mar 31, 2017, 6:56:08 AM3/31/17
to akka...@googlegroups.com, kant kodali

Actors are objects that are scheduled on Kernel threads using ForkJoin Pool?

That's how they're implemented yeah - tasks submitted to a pool.

But that misses all the things which make the model useful: isolation and location transparency (the most important one!).

So you don't care if an actor is on the same node or not, API does not change, and "fits" as it's messaging and not RPC style which hides the fact that things are remote.

-- 
Konrad `ktoso` Malawski
Akka @ Lightbend


On 31 March 2017 at 12:53:32, kant kodali (kant...@gmail.com) wrote:

kant kodali

unread,
Mar 31, 2017, 7:27:01 AM3/31/17
to Akka User List, kant...@gmail.com
Got it! Thanks a lot!
Reply all
Reply to author
Forward
0 new messages