This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
How to implement readers-writer lock with timeout, a hard question.
- From: Chen(?)Jun(?) <chjfth at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 16 Jan 2008 09:52:15 +0800
- Subject: How to implement readers-writer lock with timeout, a hard question.
Hello everyone, I'm new to mailing list. I think this list is the proper
place to ask my question.
Is there an implementation of readers-writer lock with timeout support
on Linux(no doubt, using glibc). I've known quite some implementation of
readers-writer lock without timeout, like that in boost and ACE(by
Douglas C. Schmidt). By saying "timeout support", I mean, if some thread
acquires read or write lock but fails to get it before "timeout"
elapses, the calling thread returns as if the thread has never acquired
lock.
I had not seen an implementation on Windows 2000/XP either, but I
managed to implement it some months ago, with help of the great
QueueUserAPC Win32 function. Now, I'd like to know how to implement
readers-writer lock with timeout on Linux. Can it be implemented with
glibc or some more kernel functions must be added to fulfill this?
Searching on google for weeks and no luck. Does anyone have an idea.
Thanks in advance.