Use case: I want to load textures using the Magnum::Trade subsystem in a background thread. Basically, I have to load one texture per rendered frame, that's why I would like to minimize/hide I/O and decoding time.
Problem: I can't find a clean solution. Separate Corrade::PluginManager::Manager instances do not work, since they act upon a global, static GlobalPluginStorage without locking. The handy AnyImageImporter plugin even loads other plugins at runtime, which further complicates things.
Do you think it might be feasible to either introduce some locking on the global plugin storage or to completely decouple the Manager instances, i.e. remove any global state?
At least under Linux dlopen() and dlclose() seem to be robust against multiple calls, even from separate threads as they do locking and refcounting internally. I haven't looked at other platforms yet...
I can also understand if you say this is out of scope for Corrade. Probably I'd have to use a separate image loading library then...
Use case: I want to load textures using the
Magnum::Tradesubsystem in a background thread. Basically, I have to load one texture per rendered frame, that's why I would like to minimize/hide I/O and decoding time.Problem: I can't find a clean solution. Separate
Corrade::PluginManager::Managerinstances do not work, since they act upon a global, staticGlobalPluginStoragewithout locking. The handyAnyImageImporterplugin even loads other plugins at runtime, which further complicates things.Do you think it might be feasible to either introduce some locking on the global plugin storage or to completely decouple the
Managerinstances, i.e. remove any global state?At least under Linux
dlopen()anddlclose()seem to be robust against multiple calls, even from separate threads as they do locking and refcounting internally. I haven't looked at other platforms yet...I can also understand if you say this is out of scope for
Corrade. Probably I'd have to use a separate image loading library then...