As mentioned at the end of Section 8.3.2, basic Pthreads (POSIX.1 standard) do not have a native barrier. Write a barrier routine and test it. Include routines to create and initialize any necessary...


As mentioned at the end of Section 8.3.2, basic Pthreads (POSIX.1 standard) do not have a native barrier. Write a barrier routine and test it. Include routines to create and initialize any necessary data structures (shared variables, mutexs, condition variables), and to destroy the data structures. 8-10. The basic Pthreads (POSIX.1 standard) do not have a native read/write lock. A read/write lock is a form of lock which differentiates between read accesses and write accesses, and allows more than one thread to read the data but only one to alter it. When a thread sets a read/write lock, it specifies whether the lock is for a (shared) read access or for (exclusive) write access. The thread will not be allowed to continue if another thread has write access, but it will be allowed to continue otherwise. When multiple threads are waiting on a read/write lock, a precedence has to be established; either read accesses have precedence over write accesses, or vice versa. If read accesses have precedence on write accesses, multiple simultaneous read accesses can occur as soon as possible. If write accesses has precedence, updating the data can occur as soon as possible. Implement a read/write lock in Pthreads.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here