-1
votes
1answer
90 views

Readers and writers (writers-preference). I'm not sure whether my code is wrong or not [closed]

I've found on the wikipedia pseudo-code, so I've decided to try it. That's the Wiki's code: int readcount, writecount; (initial value = 0) semaphore mutex_1, mutex_2, mutex_3, w, r ; (initial value ...
1
vote
1answer
2k views

Producer-consumer in C using pthread_barrier

We're preparing for an exam at the moment, and our lecturer has given us a sample problem to work on. I have it completed, but would like to know a) If it is actually doing what it's supposed to, and ...
2
votes
0answers
513 views

mutex and condition variable implementation using futex

I have implemented mutex and contition variables using futex syscall. I believe that my implementation is correct, but would like it to be verified by some one else. If some of you could verify its ...