Skip to content

Instantly share code, notes, and snippets.

@yuu
Created September 5, 2019 07:14
Show Gist options
  • Save yuu/f56d547b88992e3573817aae11cec0b4 to your computer and use it in GitHub Desktop.
Save yuu/f56d547b88992e3573817aae11cec0b4 to your computer and use it in GitHub Desktop.
[c++] thread communication using eventfd

sample code wandbox

eventfd is passing counting value.

eventfd_write(fd, 1);
-> read result: 1

eventfd_write(fd, 1);
eventfd_write(fd, 1);
-> read result: 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment