Boost logo

Boost :

Subject: Re: [boost] [thread] Request review of new synchronisation object, boost::permit<>
From: Bjorn Reese (breese_at_[hidden])
Date: 2014-05-05 15:45:34


On 05/05/2014 09:21 PM, Niall Douglas wrote:

> Remind me: is proposed expected<T> still essentially the value and
> exception transport mechanism of promise<T>/future<T>? It may have
> evolved since, or I got its intent wrong.

Last I looked, yes.

>> Another useful example could be a one-to-one latch (as in N3666.)
>
> I had thought Alasdair's latch a sort of inverted semaphore? Can you
> clarify what you mean by one to one latch?

A permit triggers on the first "count-down". The "latch" should trigger
after N count-downs. This may be useful to wake up a thread for, say,
every N asynchronous operation. The idea of this example is simply to
illustrate how a permit can be combined with an atomic counter.

> If gate is no good, we could use boost::event, though I personally
> think that is a bit too likely to clash.

Gate and event are probably too general-purpose to be placed directly
in the boost namespace.


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