Subject: Re: [boost] [threads] Win32 Events on POSIX
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-02-17 08:08:24
On 17 Feb 2015 at 10:41, Fu ji wrote:
> But I see that I started really interesting conversation. It is really hard
> to port all funtionality of WFMO because you can put as parameters:
> Change notification, Console input, Event, Memory resource notification,
> Mutex, Process, Semaphore, Thread, Waitable timer.
> So we can create unified API but that kind of flexibility always provide
> performance penalty. I am not sure if something equivalent in Unix can be
> implemented on low level.
BSD and OS X implements that via kqueues. Linux is actually the odd
man out here, epoll just isn't as useful.
I believe Boost.Thread v5 intends to implement a unified wait
composure mechanism atop the C++ 11 STL which could also be hooked by
a Fiber implementation. Indeed, proposed Boost.Fiber I assume does
already implement a unified wait composure system for Fiber wait
The real bear in all these unified wait composure systems is merging
i/o waits into the same unified wait composure system. ASIO can be
persuaded via async_result, AFIO will get support in v1.4, but in the
end most C++ is still using iostreams etc. That means if you block on
i/o, your Fibers and composed waits all block too for that thread
until the i/o returns.
Probably that means someone would have to reimplement iostreams using
an async engine under the bonnet. Good luck finding commercial
funding for that.
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk