This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] pthread support for FUTEX_WAIT_MULTIPLE


* Pierre-Loup A. Griffais:

> I would think there's still a queue somewhere to acquire jobs, this
> would be used before and after. For instance, job threads want to
> sleep until work has been queued, or another system event occurs that
> might require them to wake up, like app shutdown or scene
> transition. Similarly, after firing off N jobs, the job manager will
> want to sleep until one of the jobs is complete to perform some
> accounting and publish the results to other systems. For both of these
> usecases, using eventfd to wait for multiple events seems to result in
> more CPU spinning than the futex-based solution, both in userspace and
> the kernel.

Why do you consider eventfd the only viable alternative?  If you want a
futex-based solution today, you can use condition variables.  It won't
give you the theoretical minimum of context switches, but neither does
FUTEX_WAIT_MULTIPLE, as far as I can tell.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]