Messages in this thread | | | Date | Fri, 30 May 2008 21:23:31 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [PATCH 0/3] 64-bit futexes: Intro |
| |
On Fri, 30 May 2008, Linus Torvalds wrote: > > Also note how you can use 64-bit atomic ops to do that all in user space, > without actually requiring 64-bit futex support - as long as the bits that > matter for waking (like "was there more than one pending writer") fit in > the one 32-bit word.
So here's an example of this:
- make all the readers/writers actually update a 64-bit word (by using cmpxchg8b in user space to actually get the locks)
- but organize things so that a reader only needs to look at the high 32 bits to actually make it's wakeup-decision, and a sleeping writer only needs to look at the low 32 bits. How? Make the low bits of the words contain the "contention status".
Is it possible? I dunno. I personally suspect it is. I also suspect you didn't even try.
Linus
| |