Messages in this thread | | | Subject | Re: [PATCH for 5.9 v2 1/4] futex: introduce FUTEX_SWAP operation | From | Rik van Riel <> | Date | Tue, 11 Aug 2020 11:26:20 -0400 |
| |
On Tue, 2020-08-04 at 14:31 +0200, peterz@infradead.org wrote: > On Mon, Aug 03, 2020 at 03:15:07PM -0700, Peter Oskolkov wrote: > > A simplified/idealized use case: imagine a multi-user service > > application > > (e.g. a DBMS) that has to implement the following user CPU quota > > policy: > > So the last posting made hackernews; and there a bunch expressed far > more interest in coroutines, which, if I'm not mistaken, can also be > implemented using all this. > > Would that not make for a far simpler and more convincing use-case?
Also just worker threads in general. Instead of waking up an idle worker thread every time a new request comes in, why not allow worker threads to indicate "I'm almost done", and the main/receiving thread to enqueue the new request, to be handled when the worker thread is done with the current request?
> I really think we want to have block/resume detection sorted before > this > goes anywhere, I also strongly feel BPF should not be used for > functional interfaces like that. > > That is, I want to see a complete interface before I want to commit > to > an ABI that we're stuck with.
The work case above also needs to have that figured out, for the (slow path, but still common) case of the worker thread actually having gone to sleep while the work got enqueued, and then needing to be woken up anyway.
Not sure that is a direction you are interested in, given the description, but it could make coroutines and worker threads more efficient :)
-- All Rights Reversed. [unhandled content-type:application/pgp-signature] | |