- Finding the minimum of a list of integers with threads. Complete this http://siber.cankaya.edu.tr/ozdogan/ParallelComputing/cfiles/code57_template.c template;
- The list is partitioned equally among the threads.
- The size of each thread's partition is stored in the variable (partial_list_size).
- The pointer to the start of each thread's partial list is passed to it as the pointer (list_ptr).
- The test-update operation for minimum_value is protected by the mutex-lock minimum_value_lock.
- Threads execute pthread_mutex_lock to gain exclusive access to the variable minimum_value.
- Once this access is gained, the value is updated as required, and the lock subsequently released.
- Since at any point of time, only one thread can hold a lock, only one thread can test-update the variable.
Cem Ozdogan
2010-12-13