[Gems-users] A question on event scheduling


Date: Mon, 27 Aug 2007 19:42:08 -0500
From: "Niket Agarwal (niketa@xxxxxxxxxxxxx)" <niketa@xxxxxxxxxxxxx>
Subject: [Gems-users] A question on event scheduling
>From what I understand, the EventQueue in Gems does not enforce any ordering of Consumers scheduled to wakeup at a particular time. Now suppose, I enqueue a message in a buffer which is otherwise free, at cycle 'x' and schedule the wakeup of its consumer the next cycle 'x+1'. But, the consumer is woken up by some other event during this cycle 'x' and checks this message buffer also and picks up the message during cycle 'x'. Since when a consumer wakes up, it does not know who has woken it up, this situation can certainly occur. Note that this is something that was supposed to be done in cycle 'x+1'.

This can happen for example in PerfectSwitch. Am I missing a trick here ? How does ruby avoid such a scenario ? 

Thanks, 
Niket 
[← Prev in Thread] Current Thread [Next in Thread→]