[Insight-developers] Thread safety concerns with IO Factory registration

Brad King brad.king at kitware.com
Mon Apr 16 09:10:50 EDT 2012


On 4/13/2012 8:53 AM, Bradley Lowekamp wrote:
> ImageIO libraries are still static in a shared build.
[snip]
> The current define ITK_NO_IO_FACTORY_REGISTER_MANAGER before "using ITK",
> does not provide the needed flexibility for such situations.

It disables static initialization/registration of IO types completely.
After that it is up to the application to explicitly register the IO
types it wants to use.  The auto-magical registration feature is there
to handle the common/simple use case without asking every single app
to handle it.  If you want to do something fancy then disable it and
do your own thing.

>could the ImageIO be made shared on windows?

Perhaps, and that could help avoid problems with multiple instances
of the factory registration globals (which are not the same as the
initialization handlers above).  It won't solve the registration
problem though.  At some point something has to tell ImageIO what
file types to support.

-Brad K


More information about the Insight-developers mailing list