|
Boost : |
From: Richard Hodges (hodges.r_at_[hidden])
Date: 2023-10-11 16:57:30
On Wed, 11 Oct 2023 at 14:25, Niall Douglas via Boost <boost_at_[hidden]>
wrote:
>
> 2. The `select()` operation either needs to have its semantics changed,
> or be renamed
>
I must claim some culpability for this. I was an early adopter of the
library, which itself is a distant descendant of work I and later Klemens
did to replicate Go's channel and select() in C++ I/O loops.
The Go select() function does exactly what Klemens' does - suspends until
the first source/coroutine has a value available (ties broken by pseudo
random selection in order to prevent starvation of the right-most sources),
and then continues, leaving the values in the unselected coroutines
available for subsequent select() calls.
Being a user of Asio for the past decade, It didn't occur to me that people
still actually used BSD select()...
Accepting that the name select() is not acceptable, my motivation for
encouraging Klemens to have the default xxx() function take a random ready
value, and the left_xxx() function to take the leftmost, was that taking
the leftmost ready value is very likely to lead to starvation of code that
responds to the the right-most sources delivering values if the leftmost
sources are constantly ready. xxx() is therefore the safer unsurprising
default for an inexperienced or tired developer.
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk