Quote:
Originally Posted by NevemTeve
what do you mean by "event"?
Note: select(2) and poll(2) don't actually poll, they just wait for some activity on the specified file-handles.
|
Event: a thing that happens, especially one of importance.
Examples: A keystroke is detected from a keyboard, a socket read or write has completed, Program A is executing a specific line of code and requests and that operating system take note of that so other programs will be aware that has occurred thereby synchronizing two or more applications.
Side comment: While I will look into poll(2) this is worth nothing for future use. Many programmers don't realize the importance of using clear and precise names. The use of the name poll() for an activity that does not poll is rather poor programming practice. Every time a person with a good command of the English language and with programming skills looks at code that says "poll()" they will, or should, immediately think of a polling operation. As that function does not poll, the use of the phrase "poll" is quite bad programming practice. Now, that name is embedded into the system and will probably never change. That rather badly chosen name will be with us for a long time.
I take the time to write this so that maybe one or more programmers will think just a little bit more and spend just a few more seconds creating well named functions and variables.
Back to the regularly scheduled question:
Program
Decom spawns a task named
Ethernet_Ingest to capture data via an Ethernet socket and get that data into one of two alternating buffers. Freed of that significant task, the main program waits for an event from
Ethernet_Ingest signifying that buffer A has fresh data. When the event is received it examines the appropriate buffer, extracts some chunk of data and hands it off. Then it waits for the next event from
Ethernet_Ingest. It does not poll, it suspends its operations and waits until the event is set.
How do I set up this communications between the main program and task Ethernet_Ingest?
I suspect a few people have been kind enough to document this in detail. I need some help in finding those pages.