Rethinking race-free process signaling
Rethinking race-free process signaling
Posted Apr 5, 2019 13:15 UTC (Fri) by Villemoes (subscriber, #91911)In reply to: Rethinking race-free process signaling by mezcalero
Parent article: Rethinking race-free process signaling
Yup, the robust futex implementation means one cannot use all 32 bits for a tid.
/*
* A maximum of 4 million PIDs should be enough for a while.
* [NOTE: PID/TIDs are limited to 2^29 ~= 500+ million, see futex.h.]
*/
#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
(sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
though uapi/linux/futex.h seems to imply that the actual limit is 30 bits
/*
* The rest of the robust-futex field is for the TID:
*/
#define FUTEX_TID_MASK 0x3fffffff