Quantcast
Channel: Understanding pthreads locks and condition variables - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Chris Hall for Understanding pthreads locks and condition variables

I have looked deeper into how glibc (v2.30 on Linux & x86_64, at least) implements pthread_mutex_lock() and _unlock().It turns out that _lock() works something like this: if...

View Article



Answer by Chris Hall for Understanding pthreads locks and condition variables

First, you are doing the gcd() work while holding the lock... so (a) only one thread will do any work at any one time, though (b) that does not entirely explain why only one thread appears to do...

View Article

Understanding pthreads locks and condition variables

I had an exercise about threads, locks, and condition variables in C. I needed to write a program that get data, turn it into a linked list, starting 3 threads each calculating result for each node in...

View Article
Browsing latest articles
Browse All 3 View Live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>