[Insight-developers] itkTimeStamp Test Failures Mistery

Tom Vercauteren tom.vercauteren at m4x.org
Fri Feb 20 11:22:14 EST 2009


Hey Brad,

> According to QT, the optimized timestamp is thus reentrant but not
> thread-safe:
> http://doc.trolltech.com/4.4/threads.html#reentrancy-and-thread-safety
> "By extension, a class is said to be reentrant if each and every one
> of its functions can be called simultaneously by multiple threads on
> different instances of the class. Similarly, the class is said to be
> thread-safe if the functions can be called by different threads on the
> same instance."
>
> It appears the goal here is to make itkTimeStamp thread-safe. Does any of
> ITK meet this definition? I know there are some parts which should be
> reentrant (itkObjectFactory) but are not.
> Why are we trying to get it to be thread-safe? Is this need? Where is this
> need? Does every instance of TimeStamp need to meet this requirement?
> If only some do, do we need two types of TimeStamp class say:
> itkTimeStamp - guaranteed to be only reentrant.

I definitely agree that these are the questions we need to answer.


> itkThreadSafeTimeStamp - guaranteed to be thread-safe as per the above
> definition
> I just wanted to check to see why this test was written the way it was and
> if it was intentionally done so.

Well I wrote that test :(
I just used the simplest framework I could think of at that time to
test the timestamp. Guess it wasn't that easy...

Tom


More information about the Insight-developers mailing list