Boost logo

Boost :

Subject: Re: [boost] [threads] Win32 Events on POSIX
From: Rob Stewart (rob.stewart_at_[hidden])
Date: 2015-02-16 06:47:00


On February 16, 2015 3:58:08 AM EST, Andrey Semashev <andrey.semashev_at_[hidden]> wrote:
> On Monday 16 February 2015 08:30:58 Fu ji wrote:
> > Thank you for the reply. I see that you have almost all
> functionality done,
> > I miss only something equivalent to WaitForMultipleObjects it is in
> your
> > plans for the future functionality ?
>
> On POSIX systems this is only achievable with select() & co., which in
> turn
> implies that synchronization primitives must be fd-based. I currently
> have no
> plans for implementing that, mostly because I recon that such
> primitives would
> have worse performance in the normal use (i.e. when a single primitive
> is used for thread synchronization).

Performance isn't the only criteria by which to judge an API. The ability to wait on multiple synchronization primitives can be helpful in some cases regardless of performance. Obviously if performance is an issue, that must be documented.

Using the Windows API one also can wait on other handles, like process handles, and not just sync primitives. The same is possible using select if one opens a pipe or socket to the other process, since closing the other process will close its end of the IPC.

If a select()-based wait on sync primitives is possible, then a portable WaitForMultipleObjects() is possible and would be handy in one's toolbox.

___
Rob

(Sent from my portable computation engine)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk