#1 2015-04-23 15:04:43

Registered: 2014-12-12
Posts: 4

Discover module references

I'm trying to unload a module but I'm getting an error due that it is still referenced by other module. Is there a way to discover wish modules have references to my module ?



#2 2015-04-24 06:50:58

Registered: 2012-05-04
Posts: 45

Re: Discover module references


in general, no.

The CppMicroServices library tracks only service usages but this requires clients to consistently use getService / ungetService calls.

Static library dependencies (when modules depend on exported symbols of other modules during link time) could be determined at runtime with some effort but it gets really complicated when libraries use dlopen and dlsym calls themselves. In the context of module unloading with CppMicroServices, you could make your life easier by only trying to unload modules which act as pure "providers", e.g. they only register services and don't export any symbols at all. By using hidden visibility (when using ELF shared libraries) and not exporting any symbols, other libraries cannot link to the module or discover symbols at runtime with dlsym. The registered service implementations can be used by other modules and the dynamics of the CppMicroServices library ensure that clients get notified about the service withdrawal when you unload the "provider module" (which should be possible at any point in time).

- Sascha


Board footer

Powered by FluxBB