You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Alan Conway <ac...@redhat.com> on 2008/09/11 15:13:09 UTC

C++ broker: Polling for non-IO events.

FYI: I've added 2 classes to poll for non-IO events in the broker's
Poller:

sys/PollableCondition: is a generic mechansim to poll for non-IO
events in the Poller. 

sys/PollableQueue: is a thread-safe queue template that can be
dispatched from the Poller when there are items on the queue. It uses
PollableCondition.

I'm using these in the cluster code to queue cluster events for dispatch
by the poller.

PollableCondition is implemented using a pipe which is portable for
Unixen but a bit ugly. There's a better linux solution using eventfd()
on modern linux, and I'm sure the Solaris event framework has something
similar, we can add platform-specific improvements as we see fit. Sorry
about windows - currently this is only used by cluster code which won't
run on windows yet anyway so it can just be left out of windows builds
for now. I expect it may find other uses with time.

Cheers,
Alan.


RE: C++ broker: Polling for non-IO events.

Posted by Alan Conway <ac...@redhat.com>.
On Thu, 2008-09-11 at 16:13 -0400, Steve Huston wrote:
> > > Sorry
> > > about windows - currently this is only used by cluster code 
> > which won't
> > > run on windows yet anyway so it can just be left out of 
> > windows builds
> > > for now. I expect it may find other uses with time.
> > 
> > It sounds like this fits with the windows WaitForMultipleObjects
> stuff
> > which is its generic eventing mechanism?
> 
> It'll fit into the scheme I'm implementing now.
> 
> -Steve

Great - I tried to keep the API very minimal so it won't constrain
different impl strategies, but shout if it presents problems for
windows.

Cheers,
Alan.


RE: C++ broker: Polling for non-IO events.

Posted by Steve Huston <sh...@riverace.com>.
> > Sorry
> > about windows - currently this is only used by cluster code 
> which won't
> > run on windows yet anyway so it can just be left out of 
> windows builds
> > for now. I expect it may find other uses with time.
> 
> It sounds like this fits with the windows WaitForMultipleObjects
stuff
> which is its generic eventing mechanism?

It'll fit into the scheme I'm implementing now.

-Steve



Re: C++ broker: Polling for non-IO events.

Posted by Robert Greig <ro...@gmail.com>.
2008/9/11 Alan Conway <ac...@redhat.com>:

> Sorry
> about windows - currently this is only used by cluster code which won't
> run on windows yet anyway so it can just be left out of windows builds
> for now. I expect it may find other uses with time.

It sounds like this fits with the windows WaitForMultipleObjects stuff
which is its generic eventing mechanism?

RG