I am new to linux and linux streams. I spent some time searching on Google to understand the differences between all the features available for stream synchronization. I still have some questions.
I found all these different types of synchronization, each of which has a number of functions for locking, unlocking, checking locks, etc.
- gcc atomic operations
- futexes
- mutexes
- Deadlocks
- seqlocks
- rculocks
- conditions
- semaphores
My current (but probably erroneous) understanding is this:
semaphores are wide processes that are related to the file system (practically I guess) and are probably the slowest.
Futexes , , , seqlocks rculocks. Futexes , , .
Spinlocks , , . , (). . .
seq , , , . .
, , . . (mutex, futex, spin, seq, rcu) .
:
?
- ? parallelism , . - . , . .
( ) ... , . ? CPU ? , . , , , , , , . , . , , , ... .
... , ... ? (spin/seq locks), "irq".
?
- , , , - ? , . , , , . .
futexes? ?
, , ?
gcc atomic ops, test_and_set, , , test_and_set ? , , . , , . , 0. , . . , , 1. 1, , . , __set . , test_and_set 500 cpu , , cpu L2 /.... - 1 .... , 500 1, , .... .
-, , SYSTEM ( Jsut CPU) . gcc atomic ops . : , , (0 = , 1 = ). test_and_set , . .
!