Proposal: Asynchronous IO on Windows

2018-04-12 Thread Akash Gupta (EOSG)
Hi all, A few weeks ago, we found serious issues with the current asynchronous IO implementation on Windows. The two eventing libraries in Mesos (libevent and libev) use `select` on Windows, which is socket-only on Windows. In fact, both of these libraries typedef their socket type as SOCKET,

Re: Proposal: Asynchronous IO on Windows

2018-04-12 Thread Benjamin Mahler
Thanks for writing this up and exploring the different options Akash! I left some comments in the doc. It seems to me the windows thread pool API is a mix of "event" processing (timers, i/o), as well a work queue. Since libprocess already provides a work queue via `Process`es, there's some overlap

RE: Proposal: Asynchronous IO on Windows

2018-04-12 Thread Akash Gupta (EOSG)
Hi Ben, Thanks for your comments! To answer your question, we can use SetThreadpoolThreadMinimum(pool, 1) and SetThreadpoolThreadMaximum(pool, 1) to have a persistent single threaded "windows event loop" that handles the IO and timer callbacks. This way, we avoid the thread pool autoscaling b