News for hackers. Stuff that matters.
Re:A collection of lock-free data structures written in stan... by gpderetta on Wednesday May 10, 2023 @05:34PM (#35893836)
Indeed You only need to FUTEX_WAKE if you know there are waiters (or of you lost track of the number of waiters).
Re:A collection of lock-free data structures written in stan... by m4nu3l on Wednesday May 10, 2023 @07:13PM (#35894807)
What can cause the mutex to lose track of the number of waiters?
Re:A collection of lock-free data structures written in stan... by ot on Wednesday May 10, 2023 @07:20PM (#35894907)
Generally you have a small number of bits to count the waiters, because the mutex state has to be a word you can CAS and so you have either 32 or 64 bits to pack all the state you need. If your counter saturates you lose track of the waiters, and you have to fallback somehow.
Re:A collection of lock-free data structures written in stan... by m4nu3l on Thursday May 11, 2023 @02:44AM (#35898597)
Makes sense, thanks for the explanation!