Idea of maintaining an Island state without running the Island all the time

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Idea of maintaining an Island state without running the Island all the time

Baldur Jóhannsson
Hello all.

  Must an Croquet Router have at least one client (an headless one if you will) to maintain the Croquet Island the Croquet Router is routing for? Yes.
  But does that client have to be running the Island all the time
  to keep the Islands state up to date? No

  Why not append to the Islands serialized state the incoming invokations of methods and their parameters in serialized form?

  And when the size of the serialized invokations reaches some predefine limit then:
  1. the Island can be instanced from its serialized form (excluding invokations)
  2. the invokations are then invoked on that Island instance
  3. then that Island instance is serialized and is now the up to date version of the Island with out the extra invokations.

  Or does Croquet do this already?

  I want your thoughts on this and please ask me if I need to clarify something in this post.
-Zarutian
Reply | Threaded
Open this post in threaded view
|

Re: Idea of maintaining an Island state without running the Island all the time

Andreas.Raab
Hi -

Croquet doesn't do that out of the box but it is a strategy that we have
considered on servers for load balancing. Basically, the ideas like you
say that the island doesn't have to run all the time in particular if
nobody requests its state. In this case, you can simply serialize it to
disk and keep it there until somebody needs it. To deal with incoming
messages, you can create a log of messages which are replayed the next
time somebody requests the island to keep it up to date.

Cheers,
   - Andreas

Zarutian wrote:

> Hello all.
>
>   Must an Croquet Router have at least one client (an headless one if you will) to maintain the Croquet Island the Croquet Router is routing for? Yes.
>   But does that client have to be running the Island all the time
>   to keep the Islands state up to date? No
>
>   Why not append to the Islands serialized state the incoming invokations of methods and their parameters in serialized form?
>
>   And when the size of the serialized invokations reaches some predefine limit then:
>   1. the Island can be instanced from its serialized form (excluding invokations)
>   2. the invokations are then invoked on that Island instance
>   3. then that Island instance is serialized and is now the up to date version of the Island with out the extra invokations.
>
>   Or does Croquet do this already?
>
>   I want your thoughts on this and please ask me if I need to clarify something in this post.
> -Zarutian
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Idea of maintaining an Island state without running the Island all the time

Howard Stearns
In reply to this post by Baldur Jóhannsson
Let's go back to the turning sky box example.  Suppose we arrange for  
the island to stop executing when there is one "update skybox"  
message pending, and nothing else.  If it had continued to execute,  
then, upon receiving the first heartbeat scheduled for after the  
update message's scheduled time, the update would be executed. The  
execution would have put another "update skybox" message on the  
queue, and the whole mechanism repeats.  But since we're not  
executing messages in this scenario, we never get another update  
message. We never get an accumulation of a "certain limit" of pending  
messages.  It is only when we explicitly intervene and turn on  
message execution again, that we execute the first message, which  
causes a second, which causes a third, and so on until we have  
repeated the whole mechanism the usual number of times. The only  
difference in the delayed execution vs normal execution is that the  
the delayed machine turns as fast as the processor can execute,  
rather than pausing to wait for heartbeats as the "real time" machine  
does. (In the original scenario, I think you said the "server"  
participant would be headless, so we can leave rendering out of the  
story.)


On Aug 22, 2006, at 9:30 PM, Zarutian wrote:

> I assumed that Croquet Routers sent Tick messages to advance the  
> time in the Island and these messages got no special treatment when  
> they are serialized.

They might be special. There are two queues. One in the controller  
and one in the island. You'll have to look to see:
   1. if heartbeats never show up on the island queue. Why would  
they? They're just used to set the time to execute to.
and
   2. if only the island queue is part of the snapshot.

But regardless, I don't think this affects whether or not you can get  
what you want by simply turning off execution, nor whether you may  
need to halt/reset router time in order to be happy with getting what  
you want.

>
> But I think I understand your point about users haveing to wait for  
> an island to catch up with real time. And I thought of that.
>
> Therefore I proposed that when the number of serialized messages  
> has reached an certain limit then the Islands serialized state  
> would be compacted in the manner I descriped above.
>
> Good rule of thumb: if you have time to cheer the program on it  
> isnt responsive enaugh ;c)
>
> Thanks for the responses.
> -Zarutian
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Idea of maintaining an Island state without running the Island all the time

Joshua Gargus-2
In reply to this post by Baldur Jóhannsson
I see no reason why your proposal is infeasible.  However, what do  
you hope to gain by it?

The first 2 possibilities that popped into my head:
        1) If the world is large enough to take a significant time to  
snapshot, then you can reduce response latency to sync requests by  
having a recently-cached snapshot ready.  Is this really worth it?  
You'd have to profile it.  I suspect that the download time over DSL  
would dominate the snapshot time.
        2) Failure recovery... if your router crashes, you have a recent  
snapshot of the world to recover from.  This would be cool, but would  
require additional mechanisms beyond what you have described (at  
least to do automatically).

Were either of these what you had in mind?  Or are you thinking of  
other benefits?

Josh



On Aug 24, 2006, at 8:49 PM, Zarutian wrote:

>
> I meant "certain" limit as in number of messages recived such as 100.
>
> so the CroquetIsland running server basicly performs this:
>  when an message is receibed:
>   1. append the message to the serialized state of the Island
>   2. if the number of messages that have been recived and appended
>      exceeds say 1000 then instanceate the Island from its serialized
>      state, execute the appended messages and serialize the resulting
>      Island as the new serialized state of the Island.
>
> That is basicly it and I thought it didnt require clarifaction but  
> obviously did.
>
> Please continue to give feedback on this matter ;c)
>
> -Zarutian