[lttng-dev] urcu rfc: privatize urcu/futex.h

Lai Jiangshan laijs at cn.fujitsu.com
Tue Aug 7 21:03:49 EDT 2012


On 08/07/2012 10:06 PM, Mathieu Desnoyers wrote:
> Hi Lai,
> 
> * Lai Jiangshan (laijs at cn.fujitsu.com) wrote:
>> futex.h is in urcu/, it means it can be used by users out of the library.
>>
>> But
>>
>> If the user's system has futex, he should use #include <linux/futex.h>.
>> If the user's system don't have futex, it is not good that if the user
>> use this compat_futex.
>>
>> Because the compat_futex_async()'s behavior is different from the
>> futex in linux.  If the caller don't change the value of @uaddr, the
>> futex(FUTEX_WAKE) in linux can also wake a thread, but
>> compat_futex_async() don't.  (I guess no one use this behavior, but if
>> there are someone, we give them a wrong thing)
> 
> Hrm, passing a NULL uaddr parameter is really not the targeted use-case.
> We could probably just document that uaddr should not be NULL when using
> compat_futex ?

Sorry, I wanted to show you such un-normal behavior:

/* keep the value of *uaddr unchanged, wake up a thread to do something */
futex(FUTEX_WAKE, uaddr, ...).

This can't not wake up any thread for current compat_futex_async() implement.
But the sys_futex() can.




More information about the lttng-dev mailing list