Queueing system without polling ...

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

Queueing system without polling ...

GLASS mailing list
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
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: Queueing system without polling ...

GLASS mailing list
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, [hidden email] via Glass <[hidden email]> 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
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass