Matthew Fulmer | 9 Jul 03:22
Gravatar

Re: Message queues: TIsland vs TIslandController

On Tue, Jul 08, 2008 at 06:07:10PM -0700, Andreas Raab wrote:
> Matthew Fulmer wrote:
> > I don't understand the relationship between TIsland and
> > TIslandController. Why do both of them have a message queue and
> > a current time?
> 
> Actually TIslandController doesn't have a current time. However, it 
> utilizes its own event loop because there is so much concurrent 
> interaction going on that it's easier to synchronize it by scheduling it 
> via its own event loop. That event queue is entirely unrelated to the 
> islands' queue.
> 
> > It seems to me that TIsland should have no notion of time, and
> > just be a message queue, while TIslandController knows about
> > time and releases messages to the TIsland when it needs them
> 
> That's exactly what the controller does. The TIsland needs its own 
> notion of time though since it must be able to schedule internal future 
> messages.
> 
> Cheers,
>    - Andreas

It seems to me that time should be seperated from the event
queue. I think it should work like this:

A TIsland has a priority queue of messages to be executed. The
Island can be started, stopped, or stepped at any time. A
TIslandController would use this low-level mechanism to
implement time, stepping the island until the time of the next
message is greater than the goal time. Messages, both internal
and external, would pass through the controller to recieve their
priority

This would also allow other messaging policies to be plugged in,
such as a simple fifo executer, that allowed all messages to run
as fast as possible in the case that no inter-island
synchronization is needed.

--

-- 
Matthew Fulmer -- http://mtfulmer.wordpress.com/


Gmane