[Glass] Queueing system without polling ...

James Foster via Glass glass at lists.gemtalksystems.com
Sat Aug 29 19:54:13 PDT 2015


The only truly non-polling approach available in GemStone today is with sockets. That is, you can wait till data is available on a socket and the VM will restart a process at that point. I think such an approach would be more work than it is worth. At the other extreme is a loop where you delay, abort, and check for data--the traditional polling approach.

In the middle is a delay loop while you wait for an object changed notification. An object changed notification will interrupt execution without you having to do an abort/commit, but it will not terminate an existing delay so the delay loop needs to be fairly short (much like your 100ms example). I recently came across this issue and entered a feature request for an interruptable delay so you can avoid the loop model entirely.

Having said all this, I think that the polling option is not really that inefficient. If there isn't much work to be done, then the time will not be significant and won't be wasted since there isn't much else that would be done with those CPU cycles. When there is a lot to do the polling will be a trivial part of the CPU effort.

James

> On Aug 29, 2015, at 7:11 AM, itlists at schrievkrom.de via Glass <glass at lists.gemtalksystems.com> wrote:
> 
> I would like to implement a system based on queues (RcQueue). One topaz
> script should wait on a RcQueue and starts working if there is an item
> available.
> 
> How can this be done ? Simple by doing AbortTransaction on a reagular
> time (100ms) - that means polling - or this a more efficient way to do
> in Gemstone ?
> 
> 
> Marten
> 
> -- 
> Marten Feldtmann
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass


More information about the Glass mailing list