Click here to Skip to main content
15,912,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Lets say i have 5 sockets FD's(5 events) added to the event loop. And there is no priority associated with any event, all are equal events.

If all the FD's are available for read at the same time,

1) In which order the callback are invoked?
2) Is all the 5 events callback will be executed one by one , before the select/epoll call is made by the event-loop? (or) the other way around like after a single event is fired independent of other FD's set or not ,again the epoll/select call is made?
3) If i want to handle certain FD's first if they are available for read/write before proceed with other FD's,Is it possible in lib-event library without assigning the priority to events?

What I have tried:

Tried with multiple events but unable to understand the exact internal of libevent callback invocation mechanism in case of multiple FD's are ready for read/write.
Posted
Updated 18-Jun-17 7:52am

1 solution

All events are independent sytem resources, so it the timing of the signaler if and when they fire.

If you want to syncronize them you must provide the logic in your code. Maybe the libuev library and documentation helps a bit more than my loose answer.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900