[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#503162: libc6: Doubt with nptl

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_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?

I do not know. May be scheduling of whole process have to be set,
may be it have to have enough priviledge to set SCHED_FIFO.
Or the manual does not reflect glibc reality.

But even in the original case, the writers are really favored over readers. When the write-lock is released, it is acquired by another writer, even iff the writer asked for a lock after reader.


Reply to: