All of lore.kernel.org
 help / color / mirror / Atom feed
* futex: wake explicit / wait on multiple memory locations
@ 2014-07-23 16:25 Milosz Tanski
  2014-07-23 22:32 ` Davidlohr Bueso
  0 siblings, 1 reply; 2+ messages in thread
From: Milosz Tanski @ 2014-07-23 16:25 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Thomas Gleixner, Eric Dumazet, Darren Hart, LKML

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.

Is there are mechanism in the futex API by which I can control which thread to wake up. Or alternatively a mechanism by which have a thread wait on multiple futex memory locations?

Thanks in advance,
- Milosz

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: futex: wake explicit / wait on multiple memory locations
  2014-07-23 16:25 futex: wake explicit / wait on multiple memory locations Milosz Tanski
@ 2014-07-23 22:32 ` Davidlohr Bueso
  0 siblings, 0 replies; 2+ messages in thread
From: Davidlohr Bueso @ 2014-07-23 22:32 UTC (permalink / raw)
  To: Milosz Tanski
  Cc: Ingo Molnar, Thomas Gleixner, Eric Dumazet, Darren Hart, LKML

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-23 22:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 16:25 futex: wake explicit / wait on multiple memory locations Milosz Tanski
2014-07-23 22:32 ` Davidlohr Bueso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.