[Insight-users] Question for SingleBitBinaryImage

Dan Mueller dan.muel at gmail.com
Thu Nov 18 06:45:00 EST 2010


Hi Volodymyr,

(I have also posted to Insight-Users mailing list)

This is a good question. I would say that SingleBitBinaryImage is NOT
safe for writing from multiple threads. The reason being that another
thread may have written the 32-bit mask before the current thread
does. The only way it can be thread safe is if the multi-threader
divides the image into regions exactly aligned with the underlying
32-bit masks (eg. the regions are modulo 32).

Please add a review to the Insight Journal, and I will try to think of
the best way to address this...

Regards, Dan

On 18 November 2010 11:44, Владимир Ткачук <vova.tkachuk at gmail.com> wrote:
> Hello!
>
> I read your article "Alternative Memory Models for ITK Images" at ITK
> journal. And I want to use itk::SingleBitBinaryImage.
>
> But I cannot clearly understand, how it feel with multi threading. It
> is definitely safe for read, what about writing? If two regions do not
> overlap in pixels, but in fact use the same "unsigned int" memory
> block? For instance one use first 16 bits (pixels), and another - last
> 16 bits. Is it safe for parallel writing? Can I use
> SingleBitBinaryImage<> as output for standard ITK filters (such as
> BinaryThresholdFilter) as it, or additional work around needed?
>
>
> Thank you for answers,
>
> Volodymyr Tkachuk
>


More information about the Insight-users mailing list