Opened 3 years ago

Last modified 5 months ago

#16846 closed enhancement

The future of fd stateful monitoring / eventing in Haiku — at Version 2

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: Kits/Kernel Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by kallisti5)

Today Haiku offers a "wait_for_objects" API (stateless) which is as close as we get to epoll / kqueue which exists on OS X / FreeBSD / Linux.

Pulkomandy pointed out a great overview here:

https://fosdem.org/2021/schedule/event/file_descriptor_monitoring/

... and some previous work around event polling here:

https://github.com/hamishm/haiku/tree/eventqueue

A good model would likely be:

  1. Implement a fairly standard/complete io_uring (fd and sockets)
  2. Add epoll/kqueue compatibility functions which silently leverage io_uring
  3. Drop wait_for_objects or make it official. (only consumer seems to be power daemon https://git.haiku-os.org/haiku/tree/src/servers/power/power_daemon.cpp#n118)

That video mentions performance improvements at large scale for things leveraging epoll/kqueue/io_uring over the POSIX poll/select

Change History (2)

comment:1 by kallisti5, 3 years ago

Description: modified (diff)
Summary: Better document wait_for_objects API calls, or reimplement?The future of fd stateful monitoring / eventing in Haiku

comment:2 by kallisti5, 3 years ago

Description: modified (diff)
Keywords: io_uring added
Note: See TracTickets for help on using tickets.