[dll] Notifying a plugins host that a plugin should be unloaded

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[dll] Notifying a plugins host that a plugin should be unloaded

Boost - Users mailing list

Hi all,

 

I have an application that uses boost.dll to provide plugin functionality.

 

I have a base class defined that all plugins derive from. I’m looking for a way to notify the host application that a particular plugin should be unloaded. This is determined by the plugin itself.

 

Is signals/slots appropriate here or is there a better option?

 

Has anyone else done anything like this?

 

Any help appreciated.

 

Kind regards

Sean.


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [dll] Notifying a plugins host that a plugin should be unloaded

Boost - Users mailing list

You cannot unload from the slot because (plugin signal) --- invokes ---> (slot). So the plugin is in use until the signal invocation has returned.

Therefore the slot must arrange for deferred unloading of the plugin. How can the deferred method know whether the signal invocation has completed? By using a semaphore, for example. The semaphore must be known to both the plugin and the main application, and (in case of an unnamed semaphore) its address must physically reside in the main application’s address space.

 

It’s tricky and you should rather be asking yourself: “why bother”?

 

  • Stian

 

From: Boost-users <[hidden email]> On Behalf Of Sean Farrow via Boost-users
Sent: Friday, March 29, 2019 08:33
To: '[hidden email]' <[hidden email]>
Cc: Sean Farrow <[hidden email]>
Subject: [Boost-users] [dll] Notifying a plugins host that a plugin should be unloaded

 

Hi all,

 

I have an application that uses boost.dll to provide plugin functionality.

 

I have a base class defined that all plugins derive from. I’m looking for a way to notify the host application that a particular plugin should be unloaded. This is determined by the plugin itself.

 

Is signals/slots appropriate here or is there a better option?

 

Has anyone else done anything like this?

 

Any help appreciated.

 

Kind regards

Sean.


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users