[asio] inefficiency in the polling
The current run/poll_one does polling regardless if there's task in the queue. If there's task in the queue, polling is just a waste of system call, since there's already a job to do. Also, my common use case is "wait and consume all work", which is not covered efficiently by current design. (run_one+poll takes two system calls) Side note: on Windows asio performs even worse, it only retrieve one event per syscall... Not sure if it's intended. Friendly note: please use "Reply to All" when replying to me.
Data on the network may be more high-priority than work in the queue.
This is the case for example for financial applications which need to react
to market data coming from the network as quickly as possible.
On 27 September 2016 at 16:10, Tatsuyuki Ishi
The current run/poll_one does polling regardless if there's task in the queue.
If there's task in the queue, polling is just a waste of system call, since there's already a job to do.
Also, my common use case is "wait and consume all work", which is not covered efficiently by current design. (run_one+poll takes two system calls)
Side note: on Windows asio performs even worse, it only retrieve one event per syscall... Not sure if it's intended.
Friendly note: please use "Reply to All" when replying to me.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/ mailman/listinfo.cgi/boost
On September 27, 2016 11:10:16 AM EDT, Tatsuyuki Ishi
The current run/poll_one does polling regardless if there's task in the queue.
If there's task in the queue, polling is just a waste of system call, since there's already a job to do.
Your comments on Asio are, no doubt, important, but the maintainer follows a separate mailing list just for Asio. You'll need to direct your comments there to get much traction. -- Rob (Sent from my portable computation device.)
On 27-09-16 17:10, Tatsuyuki Ishi wrote:
The current run/poll_one does polling regardless if there's task in the queue.
If there's task in the queue, polling is just a waste of system call, since there's already a job to do. This is not accurate. You cannot do fair scheduling unless you know the work available. Neglecting some of the work leads to possible starvation of those tasks (imagine if the task in queue posts a new task every time. Your suggestion would **never** poll at all).
Seth
participants (4)
-
Mathias Gaunard
-
Rob Stewart
-
Seth
-
Tatsuyuki Ishi