2008/10/23 Petr Salinger <[EMAIL PROTECTED]>: > The presented behaviour of pthread_rwlock_rdlock() is POSIX compliant. > > The http://opengroup.org/onlinepubs/007908799/xsh/pthread_rwlock_rdlock.html > says explicitely: > > The calling thread acquires the read lock if a writer does not hold the lock > and there are no writers blocked on the lock. > It is unspecified whether the calling thread acquires the lock when a > writer does not hold the lock and there are writers waiting for the lock. > > Petr >
Thank you very much for answering me. And if you don't mind I'll ask one more question. In the open group manual there is this line "Implementations are allowed to favour writers over readers to avoid writer starvation." And linux manual says: "If the Thread Execution Scheduling option is supported, and the threads involved in the lock are executing with the scheduling policies SCHED_FIFO or SCHED_RR, the calling thread shall not acquire the lock if a writer holds the lock or if writers of higher or equal priority are blocked on the lock; otherwise, the calling thread shall acquire the lock." The sysconf call showed that "_SC_THREAD_PRIORITY_SCHEDULING" option is enabled in my system. But adding "pthread_attr_setschedpolicy(&pthread_attr, SCHED_FIFO)" line before the "pthread_create" call didn't affect anything. What's wrong now? Alexey Salmin