Re: [akka-user] Creation of top-level actors

46 views
Skip to first unread message

Björn Antonsson

unread,
Aug 15, 2012, 4:18:04 AM8/15/12
to Akka User List
Hi Erik,

On Monday, 13 August 2012 at 15:12, Erik Allik wrote:
Hello everybody,

I'm sending this e-mail to the user group because I have not been able to find an answer to this (and several other architectural) questions by googling.

In the process of trying to understand some of the core inner workings of Akka actors, I stumbled upon the question of why are top-level actors created synchronously, i.e. why is such special casing necessary. I would greatly appreciate it if somebody could shed light on this, or point me to some resources on the internet instead.

You are right that in 2.0.x the top level actors are created synchronously. This is being rewritten in 2.1 for performance and consistency reasons.

The reason that the top level actors are created synchronously in 2.0.x is that when you do system.actorOf you creating an actor from outside of the actor system and expect to get a fully functioning ActorRef. The top level data structure is a shared data structure and needs to be protected, hence the synchronous behavior.

If you on the other hand do context.actorOf inside an actor, this is will only affect the data structures that are owned by that actor. It is still synchronous viewed from that actor but asynchronous related to every other actor. 

Hope this helps.
 
B/


Regards,
Erik Allik

P.S. I'm generally interested in the architecture behind the roots of actor systems (guardian, system, user, whatnot) and how the low level parts (Create, Link, watching, remote actor creation—all that is normally hidden away behind the curtains of parental supervision) of Akka work.

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
 
 

-- 
Björn Antonsson
Typesafe - The software stack for applications that scale

Reply all
Reply to author
Forward
0 new messages