What are the minimal blocking primitives in Linux

What are the minimal blocking primitives in linux. I know about futex_waitand futex_wake. But futexes can be used for signaling in addition to blocking. What is the minimum fixing primitive and where can I find it in the glibc library? Secondly, are condition variables also based on futexes?

+3
source share
2 answers

Read various docs on futex -es, including futex (2) and futex (7) man pages. You will find out that pthread lock primitives are implemented with a mixture of futexes and build code (by doing things not visible in portable C99)

(as I said in the comment)

+1

, " ", , "" .

  • , , , . 11 , atomic_flag .
  • . linux futex .

Spinlocks , , . , . atomic_flag C.

, .

0

All Articles