[1.34.0beta] Fault in read_write_mutex - write_locked query

Hello! I am very happy to see that the read_write_mutex has returned to boost. I am particularly grateful that there is now scheduling configuration too. This is very cool. In the latest beta version of read_write_mutex I noticed a small fault with the bool write_locked() const query in various classes in the detail/read_write_mutex.hpp file performing a != instead of an == comparison. I noticed this primarily because I make this mistake all the time! Attached is the beta version of detail/read_write_mutex.hpp modified to use ==. I hope this helps, Neil Groves

Opinions? Anybody? Thomas In article <00b101c78ff2$b3d81950$1b884bf0$@pipex.com> "Neil Groves"<neilgroves@dial.pipex.com> wrote:
This is a multipart message in MIME format.
------=_NextPart_000_00B2_01C78FD1.2CC67950 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit
Hello!
I am very happy to see that the read_write_mutex has returned to boost. I am particularly grateful that there is now scheduling configuration too. Thisis very cool.
In the latest beta version of read_write_mutex I noticed a small fault with the bool write_locked() const query in various classes in the detail/read_write_mutex.hpp file performing a != instead of an == comparison. I noticed this primarily because I make this mistake all thetime!

Thomas Witt <witt@acm.org> writes:
Opinions? Anybody?
read_write_mutex should not be in 1.34. We removed it, because it has not been fixed since the 1.33 version that was removed. There is a new version under development, but it has breaking changes to the interface, and is not yet "ready". Anthony -- Anthony Williams Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

In article <d51bd9em.fsf@yahoo.com> Anthony Williams<anthony_w.geo@yahoo.com> wrote:
Thomas Witt <witt@acm.org> writes:
Opinions? Anybody?
read_write_mutex should not be in 1.34. We removed it, because it has not beenfixed since the 1.33 version that was removed.
No it's not removed there is a #error directive in there and that's it. Cansomebody with understanding for boost.thread please fix this? Thomas

Thomas Witt <witt@acm.org> writes:
In article <d51bd9em.fsf@yahoo.com> Anthony Williams<anthony_w.geo@yahoo.com> wrote:
Thomas Witt <witt@acm.org> writes:
Opinions? Anybody?
read_write_mutex should not be in 1.34. We removed it, because it has not beenfixed since the 1.33 version that was removed.
No it's not removed there is a #error directive in there and that's it. Cansomebody with understanding for boost.thread please fix this?
I've removed the read_write_mutex source files and header from the 1.34 branch. Anthony -- Anthony Williams Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Anthony Williams wrote:
Thomas Witt <witt@acm.org> writes:
In article <d51bd9em.fsf@yahoo.com> Anthony Williams<anthony_w.geo@yahoo.com> wrote:
Thomas Witt <witt@acm.org> writes:
Opinions? Anybody? read_write_mutex should not be in 1.34. We removed it, because it has not beenfixed since the 1.33 version that was removed. No it's not removed there is a #error directive in there and that's it. Cansomebody with understanding for boost.thread please fix this?
I've removed the read_write_mutex source files and header from the 1.34 branch.
Ok, it happened again. Does not matter anyways. I decided to let the code in there intentionally, but had the error macro clearly tell the user: "Read Write Mutex is broken, do not include this header." Also I fixed the documentation to make things clear as well. (Not clear enough it seems though.) Since I repeadetly find myself in just beeing overruled in my decisions, (without beeing asked first) I just suggest to hand over my duties to someone more respected. Since I also find myself not beeing able to spend a lot of time on the work on Boost.Thread because of other projects, I'd like to ask if Anthony is willing to take over all my duties too. I think Anthony has proven to be better prepared for this task than me. Roland

On Thu, 2007-05-10 at 13:04 +0200, Roland Schwarz wrote:
Anthony Williams wrote:
Thomas Witt <witt@acm.org> writes:
In article <d51bd9em.fsf@yahoo.com> Anthony Williams<anthony_w.geo@yahoo.com> wrote:
Thomas Witt <witt@acm.org> writes:
Opinions? Anybody? read_write_mutex should not be in 1.34. We removed it, because it has not beenfixed since the 1.33 version that was removed. No it's not removed there is a #error directive in there and that's it. Cansomebody with understanding for boost.thread please fix this?
I've removed the read_write_mutex source files and header from the 1.34 branch.
Ok, it happened again. Does not matter anyways. I decided to let the code in there intentionally, but had the error macro clearly tell the user: "Read Write Mutex is broken, do not include this header."
Also I fixed the documentation to make things clear as well. (Not clear enough it seems though.)
Since I repeadetly find myself in just beeing overruled in my decisions, (without beeing asked first) I just suggest to hand over my duties to someone more respected.
Since I also find myself not beeing able to spend a lot of time on the work on Boost.Thread because of other projects, I'd like to ask if Anthony is willing to take over all my duties too.
I think Anthony has proven to be better prepared for this task than me.
Roland
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
I would like to apologize for bringing up the fault in detail/read_write_mutex.hpp I did understand that it had been removed deliberately due to a known deadlock fault. However I was actually applauding the reintroduction of the header file to the source control repository. I think Roland, this must be your work, and I am grateful for your time and effort. I would be happy to debug the tip read_write_mutex if you wish. I did send in a slightly modified file with a fix for the write_locked query. I realize, of course, that this would not fix the all of the problems. Anyhow, I am volunteering some time. I would be happy to help. Neil Groves

Hello Anthony, Tuesday, May 8, 2007, 12:09:05 PM, you wrote:
Thomas Witt <witt@acm.org> writes:
Opinions? Anybody?
read_write_mutex should not be in 1.34. We removed it, because it has not been fixed since the 1.33 version that was removed.
There is a new version under development, but it has breaking changes to the interface, and is not yet "ready".
Excuse me for a bit of offtopic. Is this new version in the CVS HEAD? If not, is it available somewhere? I'm asking because I use it in my upcoming library the way it is in the HEAD. -- Best regards, Andrey mailto:andysem@mail.ru

Andrey Semashev <andysem@mail.ru> writes:
Hello Anthony,
Tuesday, May 8, 2007, 12:09:05 PM, you wrote:
Thomas Witt <witt@acm.org> writes:
Opinions? Anybody?
read_write_mutex should not be in 1.34. We removed it, because it has not been fixed since the 1.33 version that was removed.
There is a new version under development, but it has breaking changes to the interface, and is not yet "ready".
Excuse me for a bit of offtopic. Is this new version in the CVS HEAD? If not, is it available somewhere? I'm asking because I use it in my upcoming library the way it is in the HEAD.
No, it's on the thread_rewrite branch. We intend to move it to the main development branch after the switch to subversion. Anthony -- Anthony Williams Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

Hello Anthony, Wednesday, May 9, 2007, 10:55:57 AM, you wrote:
Excuse me for a bit of offtopic. Is this new version in the CVS HEAD? If not, is it available somewhere? I'm asking because I use it in my upcoming library the way it is in the HEAD.
No, it's on the thread_rewrite branch. We intend to move it to the main development branch after the switch to subversion.
I've tried to compile this version with VC8 and got errors that boost::detail::win32::timeout is not defined. I guess this constant is missing in the thread_primitives.hpp file. I've attached the patch that fix it. BTW, will there be any way to specify the priority for readers and writers for read/write mutex? -- Best regards, Andrey mailto:andysem@mail.ru

Andrey Semashev <andysem@mail.ru> writes:
Hello Anthony,
Wednesday, May 9, 2007, 10:55:57 AM, you wrote:
Excuse me for a bit of offtopic. Is this new version in the CVS HEAD? If not, is it available somewhere? I'm asking because I use it in my upcoming library the way it is in the HEAD.
No, it's on the thread_rewrite branch. We intend to move it to the main development branch after the switch to subversion.
I've tried to compile this version with VC8 and got errors that boost::detail::win32::timeout is not defined. I guess this constant is missing in the thread_primitives.hpp file. I've attached the patch that fix it.
Oops, I forgot to check that in. Thanks for spotting.
BTW, will there be any way to specify the priority for readers and writers for read/write mutex?
No. This implementation is "fair" --- blocked writers will stop new readers, but when the current writer or last current reader unlocks, all waiting threads are unblocked, so one waiting writer or some waiting readers may then proceed. Anthony -- Anthony Williams Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
participants (5)
-
Andrey Semashev
-
Anthony Williams
-
Neil Groves
-
Roland Schwarz
-
Thomas Witt