Summary

Synchronization can be used to coordinate the order of execution of processes and threads called task synchronization as well as access the shared data called data synchronization . There are four basic task synchronization relationships. A start-to-start relationship means task A cannot start until task B starts. A finish-to-start relationship means task A cannot finish until task B starts. A start-to-finish relationship means task A cannot start until task B finishes. A finish-to-finish (FF) relationship means task A cannot finish until task B finishes. The POSIX standard defines a condition variable of type pthread_cond_t that can be used to implement these task synchronization relationships.

The algorithm types of the PRAM model can be used to describe data synchronization. EREW (exclusive read exclusive write) access policy can be implemented with a mutex semaphore. The mutex semaphore protects the critical section by serializing entry into the critical section. Either read access or write access is allowed. The POSIX standard defines a mutex semaphore of type pthread_mutex_t that can be used to implement an EREW access policy. Read “write locks can be used to implement the CREW access policy. CREW access policy describes multiple concurrent reads of data but an exclusive write to that data. The POSIX standard defines a read “write lock of type pthread_rwlock_t . An object-oriented approach to data synchronization embeds synchronization inside the data object.



Parallel and Distributed Programming Using C++
Parallel and Distributed Programming Using C++
ISBN: 0131013769
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net