Re: [RFC PATCH v2 00/13] Add futex2 syscall

2021-03-08 Thread Zebediah Figura
On 3/3/21 6:42 PM, André Almeida wrote: ** The wait on multiple problem The use case lies in the Wine implementation of the Windows NT interface WaitMultipleObjects. This Windows API function allows a thread to sleep waiting on the first of a set of event sources (mutexes, timers, signal

Re: [RFC PATCH 03/13] futex2: Implement vectorized wait

2021-02-15 Thread Zebediah Figura
On 2/15/21 2:03 PM, Gabriel Krisman Bertazi wrote: > André Almeida writes: > >> Add support to wait on multiple futexes. This is the interface >> implemented by this syscall: >> >> futex_waitv(struct futex_waitv *waiters, unsigned int nr_futexes, >> unsigned int flags, struct timespec *t

Kernel interface for Wine synchronization primitives

2021-01-17 Thread Zebediah Figura
lly consumes things, or like read() on a vectored set of file descriptors. This doesn't necessarily mean we have to replicate the manual/auto distinction in the kernel; we can handle that in user space. This by itself doesn't actually seem all that unreasonable, but... * A blocking operat

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 8:22 PM, Zebediah Figura wrote: On 7/31/19 7:45 PM, Thomas Gleixner wrote: If I assume a maximum of 65 futexes which got mentioned in one of the replies then this will allocate 7280 bytes alone for the futex_q array with a stock debian config which has no debug options enabled which

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 7:45 PM, Thomas Gleixner wrote: If I assume a maximum of 65 futexes which got mentioned in one of the replies then this will allocate 7280 bytes alone for the futex_q array with a stock debian config which has no debug options enabled which would bloat the struct. Adding the futex_wait

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 5:39 PM, Thomas Gleixner wrote: On Wed, 31 Jul 2019, Zebediah Figura wrote: On 7/31/19 7:06 AM, Peter Zijlstra wrote: On Tue, Jul 30, 2019 at 06:06:02PM -0400, Gabriel Krisman Bertazi wrote: This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows a thread to wait on

Re: [PATCH RFC 2/2] futex: Implement mechanism to wait on any of several futexes

2019-07-31 Thread Zebediah Figura
On 7/31/19 7:06 AM, Peter Zijlstra wrote: On Tue, Jul 30, 2019 at 06:06:02PM -0400, Gabriel Krisman Bertazi wrote: This is a new futex operation, called FUTEX_WAIT_MULTIPLE, which allows a thread to wait on several futexes at the same time, and be awoken by any of them. In a sense, it implement