ofthread test

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

ofthread test

#1 Post by Shaeto »

rw-lock test is not correct in ofstd/tests/tthread.cc, code use assumption that RWLockT1 (RWLockerT1) starts before RWLockT2 (RWLockerT2), this is not correct, pthread_create does not guarantee execution order and Mac OS X (El Capitan) time to time starts T2 before T1

easiest but not very correct fix is add OFStandard::milliSleep(wait_timeout) after line 302 and after line 424

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: ofthread test

#2 Post by Jan Schlamelcher »

Thanks! We already noticed the problematic behavior of this unit test, but no one had the time to track it down so far. I have added your information to our bug tracker and assigned it to someone that already indicated his interest in looking at it. Let's see if this finally fixes those problems under OS X.

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: ofthread test

#3 Post by Jan Schlamelcher »

It's fixed in this commit, thanks again for your input!

Shaeto
Posts: 147
Joined: Tue, 2009-01-20, 17:50
Location: CA, USA
Contact:

Re: ofthread test

#4 Post by Shaeto »

np, thank you for the perfect framework,

btw if someone is interesting i (re-)implemented OFSemaphore on Mac OS El Capitan using c++11 mutex/condition_variable classes

not sure how to attach files to board now

Jan Schlamelcher
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 318
Joined: Mon, 2014-03-03, 09:51
Location: Oldenburg, Germany

Re: ofthread test

#5 Post by Jan Schlamelcher »

Sure, that should be helpful in general since the C++11 primitives are (finally!) platform independent. We'll need some preprocessor magic though, since DCMTK still needs to be compilable using pre C++11 compilers (yes, this hurts badly if you are used to C++11 features). Just send the patch to Image and we'll see if it can be integrated without problems.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest