On Wed, 11 Oct 2023 at 14:25, Niall Douglas via Boost
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