Thread
  • Kernel Thread
  • To 'up' a futex, execute the proper assembler instructions that will cause the host CPU to atomically increment the integer. Afterwards, check if it has in fact changed from 0 to 1, in which case there were no waiters and the operation is done.
  • Waiting on a futex, to 'down' it, is the reverse operation. Atomically decrement the counter and check if it changed to 0, in which case the operation is done.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License