lkml.org 
[lkml]   [2014]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: futex: wake explicit / wait on multiple memory locations
From
Date
On Wed, 2014-07-23 at 12:25 -0400, Milosz Tanski wrote:
> I'm using futexes to control scheduling for a userspace application with multiple queues.
> There's a global work queue and a specific pre-thread queue. And I would like to have a
> choice between waking up any thread or a specific thread.

I'm afraid not: the api does not have a place for such an argument:

FUTEX_WAKE
This operation wakes at most val processes waiting
on this futex address (i.e., inside FUTEX_WAIT).
The arguments timeout, uaddr2 and val3 are ignored.

In any case, when you start with this sort of thing it starts to get
messy, real fast. You have to play games with the number of tasks to
wakeup in a single futex wake call vs the "chosen" task(s).

> Is there are mechanism in the futex API by which I can control which thread to wake up.

Nope. FIFO and rt tasks always in front.

Thanks,
Davidlohr



\
 
 \ /
  Last update: 2014-07-24 01:01    [W:0.051 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site