Indeed, but the point is that the mechanism extends beyond just the signal functions. Maybe a package Signal_safe_operations.
On Friday, January 15, 2016 at 8:49:13 AM UTC+10, Stefan Karpinski wrote: > > The fact that it's hard is all the more reason to provide a mechanism that > does it right. > > On Thu, Jan 14, 2016 at 5:27 PM, <[email protected] <javascript:>> wrote: > >> You are probably going to have to use ccall anyway to do things like save >> state. Only a limited set of system calls are available to signal >> handlers, see http://man7.org/linux/man-pages/man7/signal.7.html, and >> you can't rely on normal Julia IO to only use the allowed ones. Same for >> anything else that uses system calls. >> >> >> On Thursday, January 14, 2016 at 11:29:26 PM UTC+10, John Travers wrote: >>> >>> I know this, but this can be very important for codes running on >>> simulation servers. Often signals are used to tell a process to save state >>> and shut down as it is going to be moved to another system or the server >>> needs maintenance. I have to handle SIGINT to do exactly this on our >>> simulation systems (currently I run python and C++ codes which can do >>> this). For this reason it would be useful to easily register julia >>> functions as signal handlers so that we can achieve something like this. >>> >>> Of course I could ccall, but I'd rather have an official way to do this. >>> >>> On Thursday, January 14, 2016 at 1:55:04 PM UTC+1, Yichao Yu wrote: >>>> >>>> On Thu, Jan 14, 2016 at 5:37 AM, John Travers <[email protected]> >>>> wrote: >>>> > No, I'm looking for operating system signal handling, like SIGINT >>>> etc. >>>> > Something like the python `signal` module. >>>> >>>> Note that the signal handler is global and julia relies on a number of >>>> them to function correctly. >>>> >>>> > >>>> > >>>> > On Thursday, January 14, 2016 at 11:25:13 AM UTC+1, Eric Forgy wrote: >>>> >> >>>> >> Is this what you are looking for? >>>> >> >>>> >> http://julialang.org/Reactive.jl/ >>>> >> >>>> >> >>>> >> On Thursday, January 14, 2016 at 6:16:20 PM UTC+8, John Travers >>>> wrote: >>>> >>> >>>> >>> Is there a way to handle signals in julia (i.e. to register >>>> handlers >>>> >>> etc.)? >>>> >>> >>>> > >>>> >>> >
