3 ms·
you can do io_submit from one thread and then have some dedicated threads do io_getevent + event signalling (comes at a price though). Still all this event goo
by MichaelMoser123 9y ago
you can do io_submit from one thread and then have some dedicated threads do io_getevent + event signalling (comes at a price though).
Still all this event goodness is not good enough for things like infiniband and the brave world of zero copy networking.
- exDM69 9y agoYeah, sure that kinda works but it won't play nice with having an event loop on network events. A typical high performance server has multiple worker threads waiting on events on a select/epoll and if you add in another thread (or several) waiting on io_getevent you end up in a rather contrived solution. You could use a pipe or eventfd or some other fd-based mechanism to wake up a worker thread on a filesystem event, but then you get two context switches (one to wake up io_getevent thread and another to wake up a worker). This carries a lot of indirect costs from jumping back and forth to the kernel. I am unaware of a solution that would make filesystem i/o and network i/o play nice in one event loop without adding some overhead.