Skip to content

mirzachi/example-poll-with-eventfd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

example-poll-with-eventfd

Simple example demonstrating unidirectional inter-thread communication with eventfd and POSIX poll.

Two event file descriptors are created. They are used by two additionally spawned threads for a unidirectional communication with the main thread. Bidirectional communication is also possible with event file descriptors, but not demonstrated here. Main thread polls periodically event file descriptors for the POLLIN (read) event. When the POLLIN event is available on any event file descriptor being polled, the main thread reads the event and can trigger some operation based on the received event (not POLLIN event, but the event/number actually sent from the additional threads).

Build

cmake -S . -B build
cmake --build build

About

Simple example demonstrating inter-thread communication with eventfd and POSIX poll.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published