Question

This question bugs me from long time. I want to know, in case of event polling mechanism. When I have a code in which I say I have 3 FDs to poll and I have assigned each interface type to each FD by which the event will be identified. The handling is also done using epoll_create(), then reception of events using epoll_wait().

Say: 3 FDs. 
1 Timer, 1 IPC, 1 MQTT -> Creation using epoll_create

But my question is who assigns the event id or interface id to the external event as the category of events and their respective interface will always be internal.

Please let me know if my question is clear or not.

Was it helpful?

Solution

I have found the answer.

Say there are 3 FDs created: 1 Timer, 1 IPC & 1 MQTT. When these are created then subsequent interfaces are assigned to each interface FD which is inturn added to Poll FD. Any event happening on each interface ID will be read by Poll FD and for which interface it happened will be known.

That's how it will be known for which interface is the event meant. Its not the case that any external module assigns the epoll interface ID, its rather handled internally.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top