[Insight-developers] RE: itkParallelSparseFieldLevelSetImageFilterTest.

Miller, James V (Research) millerjv at crd . ge . com
Tue, 26 Aug 2003 08:00:39 -0400


Josh,

I think the problem with the Barrier is in the condition variable. I dug
around the net and found a lot of threads on the "incorrect ways of
implementing condition variables".  My conclusion is that this is very
tricky.  My best guess right now is that the trouble spot is in
ConditionVariable::Wait().  From what I read on the net, if the unlocking of
the external mutex and waiting on the semaphore are performed as an atomic
operation, then another another thread can jump in between the
mutex.Unlock() and m_Semaphore.Down() calls.

There is a condition variable implementation in the boost libraries.  I was
thinking of looking at that to see if the manner in which they implemented
condition variables would work for ITK.  In the boost implementation, then
keep an explicit queue of whose waiting (rather than using the OS) for part
of the implementation.

Jim



> -----Original Message-----
> From: Joshua Cates [mailto:cates at sci . utah . edu]
> Sent: Monday, August 25, 2003 6:29 PM
> To: Miller, James V (CRD)
> Cc: Insight-Developers; Suyash P. Awate
> Subject: itkParallelSparseFieldLevelSetImageFilterTest.
> 
> 
> Hi Jim,
> 
> We added some additional testing to itkBarrierTest.cxx and 
> managed to get
> failure (timeouts) on several Windows platforms.  Looks like 
> there is a
> bug somewhere in the Windows implementation.  I will try to debug this
> locally on my Borland build.  In the meantime, I've removed 
> the offending
> code for itkBarrierTest so as not to slow down continuous builds.
> 
> Josh.
> 
> ______________________________
>  Josh Cates			
>  Scientific Computing and Imaging Institute
>  University of Utah
>  Email: cates at sci . utah . edu
>  Phone: (801) 587-7697
>  URL:   http://www . sci . utah . edu/~cates
> 
>