So my best version right now is to leave zmq_poll as was before the change,
to poll on thread safe sockets pollfd api must be used.
However the migrate to pollfd api should be pretty simple, as the polling
method signature is:

int zmq_pollfd_poll (void *p, zmq_pollitem_t *items, int nitems, long
timeout);

The method support both thread safe and regular sockets.

Right now the implementation is duplication of zmq_poll with some changes
to support pollfd, in the future once the pollfd will be stable we can
remove the redundant code.

You can take a look here:

https://github.com/somdoron/libzmq/commit/309c8d9a40b47de66541637638cad1ac1836d657

I also think that it would be smart to move zpoller from czmq to zeromq as
this is repeating in every binding implementation and the code is not
simple to implement. If it was part of zeromq making the polling on thread
safe sockets would become much easier and compatible without api changes.



On Mon, Aug 17, 2015 at 4:43 PM, Doron Somech <[email protected]> wrote:

> wIt is not level triggered by himself, only together with zmq_poll. pollfd
> is like socket fd which is edge.
>
> However we can still do it, it will be a little complicate. We need to
> reset the pollfd immediately after calling zmq_poll. This will be edge
> triggered, to make it level we have to check all events before calling
> zmq_poll again.
>
> we can have a method that do this, so binding can implement manually or
> use something like:
>
> zmq_pollfd_poll (void *p, zmq_poll_item *items, int *nitems, long
> timeout);
>
>
> On Mon, Aug 17, 2015 at 4:16 PM, KIU Shueng Chuan <[email protected]>
> wrote:
>
>> If the pollfd is level triggered, then we could just use the system
>> poll/select directly. Then check all thread safe zsocks attached to the
>> pollfd for ZMQ_EVENTS.
>>
>> It would thus be trivial to use thread safe zsocks with other event
>> loops. If pollfd is level triggered, that is.
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> [email protected]
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
>
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to