faults in dynamic libraries
Hi all.
I write a programm that uses plugins (on dl* functions base). When plugin code is free of bugs all is ok, but when plugin faults by any reason, my programm do so. I want my programm to work even if plugin dies. I see two ways:
1. handling signals
2. run plugin in different thread or process
but then:
in 1. what will be with resources, that plugin use ?
in 2. it'll be about 15-20 plugins running - so there will be 15-20 processes. And how to synchronise them all?
Got any ideas, opinions?
________________
Good hunt.
Tver mailto:[email protected]
Quoted 10 lines · Tver Mit
I write a programm that uses plugins (on dl* functions base). When plugin code is free of bugs all is ok, but when plugin faults by any reason, my programm do so. I want my programm to work even if plugin dies. I see two ways:
1. handling signals
2. run plugin in different thread or process
but then:
in 1. what will be with resources, that plugin use ?
in 2. it'll be about 15-20 plugins running - so there will be 15-20 processes. And how to synchronise them all?Got any ideas, opinions?
If a plugin shares its address space with the main program, a bug can corrupt that address space, killing the main program.
Running plugins in a separate process is the only reliable mechanism, but it probably isn't practical. Even then, a plugin may still be able to interfere with the main process if they share system resources such as file descriptors.
Signature · 1 line
Glynn Clements <[email protected]>