[Insight-developers] Multithreaded exception handling in itkConnectedComponentImageFilter

Hans Johnson hans-johnson at uiowa.edu
Fri Apr 3 17:08:18 EDT 2009


All,

Sorry to complain, and not provide a fix.  But here is the situation, I have
a program that uses the itkConnectedComponentImageFilter, and when I set
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1,  the exception at line 345 is of
src/include/InsightToolkit/BasicFilters/itkConnectedComponentImageFilter.txx
is thrown (proper behavior)

When ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=8;  the same code enters into an
infinite loop that never exits.

    336   if( threadId == 0 )
    337     {
    338     unsigned long int totalLabs = CreateConsecutive();
    339     m_ObjectCount = totalLabs;
    340     // check for overflow exception here
    341     if( totalLabs > static_cast<unsigned long int>(
    342             NumericTraits<OutputPixelType>::max() ) )
    343       {
    344       itkExceptionMacro(
    345         << "Number of objects greater than maximum of output pixel
type " );
    346       }
    347     }
    348   this->Wait();
    349 

I was wondering what the correct behavior is supposed to be in a case like
this.

http://public.kitware.com/Bug/view.php?id=8839


Thanks,
Hans




Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090403/3fd81b5d/attachment.htm>


More information about the Insight-developers mailing list