5

pthread locking and unlocking.

view full story
linux-howto

http://www.unix.com – When more than one thread is waiting for a locked mutex, which thread will be granted the lock first after it is released. In our application we want to implement FIFO thread scheduling policy i.e. Thread should get lock which one requested first for it. AIX have SCHED_FIFO thread scheduling policy but did not worked, i have added code snap shots below with output. Plz guys help us ...!! Code: #include <pthread.h> #include <stdio.h> #define NTHREADS 13   pthread_attr_t attr; pthread_mutex_t mym; pthread_once_t            OnceInit = PTH (HowTos)