Skip to content
Prev 44497 / 63421 Next

Sighandlers

Hello there,

On Sun, Nov 18, 2012 at 3:17 PM, Prof Brian Ripley
<ripley at stats.ox.ac.uk> wrote:
The extension does open a socket connection to some distant server. It
serves as a data buffer, from where the R-main thread may poll data.
This is entirely clear.

In this particular case, I used fork() to fork off a new process. For
obvious reasons, this process stayed alive beyond the R-session.  In
other words, I terminated R and my forked off process continued
running. The natural approach would be to register a sighandler and
get notified about R's termination, so that the afore mentioned
buffering process may terminate gracefuly, too.

I solved it by using pthreads rather than fork(), as the pthread is
attached to a parent process and will terminate with it.
That's a bit beyond me at the moment.


Thanks,
Ulrich