Re: [Mono-list] Question on unix signal handling

2013-01-21 Thread mickeyf
I'm finding that if I run height8's example code exactly as is, as an independent application, it works as expected. If I use that identical code to watch a UnixSignal and to shut down my application, there is no indication that SIGTERM, SIGINT or SIGQUIT are being caught. The big difference is

[Mono-list] Question on unix signal handling

2013-01-17 Thread mickeyf
I'm new to signals. Looking over the Mono docs, and various articles on the web, it's clear that this has evolved as Mono matured. I just want to make sure I understand how it actually works today, and what I should expect. I see in this documentation:

Re: [Mono-list] Question on unix signal handling

2013-01-17 Thread Ian Norton
I'd be very careful with signals and mono, for one thing, the soft-debugger uses signals to convey things like step in/out/next Remember, that signal handlers are supposed to never make function calls beyond the standard library. If you signal handler is written in c# you've already broken than

Re: [Mono-list] Question on unix signal handling

2013-01-17 Thread Robert Jordan
On 17.01.2013 17:02, mickeyf wrote: So my questions are: If I have a Mono application with an arbitrary number of threads, can I use this approach to make sure that any signal is properly caught and handled by a single method? That is, will any signals that are raised be seen only by my signal

Re: [Mono-list] Question on unix signal handling

2013-01-17 Thread mickeyf
It may be that I'm partly overthinking this. I see that the console has a CancelKeyPress Event that I can capture, so in that particular case at least, it, ahem, *should be* trivial. Thanks -- View this message in context:

Re: [Mono-list] Question on unix signal handling

2013-01-17 Thread Jonathan Pryor
On Jan 17, 2013, at 11:02 AM, mickeyf mic...@thesweetoasis.com wrote: I see in this documentation: http://oddacon.hopto.org:8181/1.1/handlers/monodoc.ashx?link=T%3AMono.Unix.UnixSignal In a multi-threaded program, a thread is selected at random among the threads that can handle the

Re: [Mono-list] Question on unix signal handling

2013-01-17 Thread mickeyf
What I was was calling a 'signal handler' for my managed code would have perhaps more correctly referred to as UnixSignal is set, now do something code. Ok, so if I have a thread in my managed code that does nothing but check UnixSignal.WaitAny, as described in height8's blog post, and then does

Re: [Mono-list] Question on unix signal handling

2013-01-17 Thread Jonathan Pryor
On Jan 17, 2013, at 4:21 PM, mickeyf mic...@thesweetoasis.com wrote: Ok, so if I have a thread in my managed code that does nothing but check UnixSignal.WaitAny, as described in height8's blog post, and then does no more than set some simple variable when that occurs, that should as safe and