Some information: i have to write a program that controls some devices (this is basic functionality). But i have to write some kind of plugin system to enable other custom functionality. I have no way of controling those plugins source quality so i figured that i will create a thread for every loaded plugin and then it will run in it’s own main loop. I am able to catch standard C++ exceptions but problem is that i have no idea how to deal with signals. Best way would be to asynchronously cancel plugin’s thread to give him chance to clean up and free resource or just kill him but do not know how to find out which thread causes current signal. Is there a way to do this without explicity saving currently excuted thread info in some variable? Or this is totaly bad idea and i should create separate process and then run the plugin?
Share
Yes, this is totally a bad idea. Threads are a cooperative, share almost everything, programming model that doesn’t provide any isolation. It’s just the wrong tool for this job.