The Artima Developer Community
Sponsored Link

Actors in Scala Forum
p.38 / message order vs. example: actor chat.

2 replies on 1 page. Most recent reply: Jul 21, 2011 8:12 AM by Martin Weber

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Martin Weber

Posts: 7
Nickname: ephaeton
Registered: Sep, 2008

p.38 / message order vs. example: actor chat. Posted: Oct 22, 2010 2:50 PM
Reply to this message Reply
Advertisement
So in theory, the actors should be able to cope with messages coming in in whatever order the mailbox spits them out. When actors have local state that is dependent on the message history though, how can you keep this up?

Looking at the example of the actor chat: how would the chatroom still be functional if it got, say, all the messages in the wrong order? (logout, post, post, login e.g.) ?

Clearly the actor behaviour IS dependant on global time (or the global view of events) and that's part of the design philosophy when it comes to actors with local state.

Why choose such an example as first example when it's exactly contrary to what is being discussed on page 38?

Now you could, of course, point to footnote 3 on p. 38 saying that the order IS indeed defined in the scala actor environment, and this is a book about actors in scala, so the complaint is void.

Well, as far as I understand fn.3 it says that messages sent from ONE actor arrive in the same order on the receiver as they were sent. In the face of concurrency this means though that in presence of MULTIPLE actors communicating with the ChatRoom the relative order of the different senders is again indetermined, which, though, will leave us with the same problem again - the local state can be 'corrupted' by different actors messaging - and the ChatRoom relying on good-willing and cooperative actors so to speak to not f*** up its local state.

Again, how does this example blend in with the information on p.38?

Thanks in advance for enlightening me.


Martin Weber

Posts: 7
Nickname: ephaeton
Registered: Sep, 2008

Re: p.38 / message order vs. example: actor chat. Posted: Dec 22, 2010 9:36 PM
Reply to this message Reply
ping?

Martin Weber

Posts: 7
Nickname: ephaeton
Registered: Sep, 2008

Re: p.38 / message order vs. example: actor chat. Posted: Jul 21, 2011 8:12 AM
Reply to this message Reply
Hmm I give up.

Flat View: This topic has 2 replies on 1 page
Topic: source code download? Previous Topic   Next Topic Topic: Coverage of STM and Akka

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use