Overview
Features
Download
Documentation
Community
Add-Ons & Services

RWLock: How to use it safely?

Please post support and help requests here.

RWLock: How to use it safely?

Postby camus » 24 Feb 2009, 16:41

Hello,

I'm new to your library, and like to say it's very nice. Congratulations. I love how clean the code is, and its nice interfaces. I'm trying to include it in my projects, and now I have my first question.

I'm trying to use the RWLock, and I cannot find a safe way for me. My application may take the read lock many times in the same thread, and may attempt to take (or even do, if there is a bug) the write lock. Both, tryWriteLock and writeLock say results are undefined in this case. So, how should I go with this?

Thanks,
Camus
"The True Nature Of The Force"
camus
 
Posts: 1
Joined: 24 Feb 2009, 16:28
Location: Argentina

Re: RWLock: How to use it safely?

Postby alex » 26 Feb 2009, 22:34

camus wrote:I'm trying to use the RWLock, and I cannot find a safe way for me. My application may take the read lock many times in the same thread, and may attempt to take (or even do, if there is a bug) the write lock. Both, tryWriteLock and writeLock say results are undefined in this case.


The constraint is imposed by the underlying platform-dependent code (POSIX for sure, I think Win32 as well). If you find a way around it, let us know.

camus wrote:So, how should I go with this?


See above. Otherwise, your only choice is to redesign (and debug) your application.
alex
 
Posts: 1156
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron