[Interest] Is it ok to use QLibrary to load and unload different shared libraries in sequence?

Thiago Macieira thiago.macieira at intel.com
Sat Oct 27 02:09:01 CEST 2018


On Friday, 26 October 2018 10:49:57 PDT Till Oliver Knoll wrote:
> > Loading two versions of the same library is even worse and far more likely
> > to cause problems. When I suggested you redesign, that would be part of
> > it and you'd need to figure out a way so that you only ever load one and
> > don't unload it.
> 
> The OP wrote: „Now I would like to add the feature to switch versions at
> runtime“
> 
> It is my understanding that we are talking about 3rd party libraries over
> which the OP has no source control, so there is nothing to redesign.

I understand what he wants to do. I am calling on a rethink of that. Either by 
isolating in different processes or by not switching at runtime at all.

> But I would /still/ want to unload a „plugin“ that is no longer required,
> especially for „design“ reasons. Why would you want to keep that „dead
> code“ in memory if the user has decided - at runtime - to use „v4.1“ now
> instead of the previous 4.0 (or 4.2)? Waste of resources.

Because of the complexity of getting it right. You have to weigh the memory 
caused by keeping it loaded versus the time it takes you to get it right.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Interest mailing list