-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signals abstraction #321
Comments
ProgressI have something not in a reviewable state, but I think now I understand all the nits for us to decide what to do: The runtime processes signals in a more native way than Ocaml runtime signals + DomainsThe runtime doesn't do a lot, basically signals are recorded in a bitmap and processed at some point outside the trampoline. This makes signals pretty hard to use with multiple domains, if we wanted to cancel some Libuv is a Good Boi (tm)Libuv handles signals in a different way, they have their own signal dispatch mechanism (therefore also run signals outside the trampoline). Each This is more useful than what the runtime offers, you can establish a OpinionI believe we should have a similar mechanism like My treeIn my tree I implemented something similar to the runtime semantics:
This is more to get things going and it might be a first step for us to define the API and get something in that at least is useful for single domains. On supported signalsI have added a |
On Linux, should we be using |
Oh that's nice, I didn't know about it, I think that simplifies a lot. |
At a high level, do we have a sense of what modern consumers of signals actually expect? The lowlevel interface is extremely difficult to get right in the presence of multiple threads, processes and runtimes. Is there anything useful beyond:
If that's it, then we could just expose those behaviours from eio and actually have a hope of making them work in a cross-platform way :-) |
SIGWINCH for terminal resizing, SIGINFO for polling program behaviour, SIGHUP for daemon reconfig
|
I'm in favour of just supporting OCaml callbacks for those usecases specifically, tied to the main domain, as none of them actually need multiple domains as far as I can tell.
|
SIGTERM for multiple domain cleanup is a kinda common thing. But I'm not gonna insist :) |
oh and I mean SIGTERM is even more crucial since you might need to be able to do things for a proper cleanup. |
Closed by #436. |
As discussed in #301 we might need to abstract Signals.
I've got a working prototype that works on uring and libuv but we have to define some things before I go forward.
1. Do we want to export more signals, less or the same as Sys ?
Sys is a bit conservative and I think we should export more, for example it misses SIGWINCH and SIGINFO (linux doesn't have this but it's popular in Unix).
2. Do we want to restrict what we export ?
Like type
signum = Sigint | Sigwhatever
, or we just keep accepting anint
and if the user wants to use whatever other signal he has, he can.I think we should keep taking an int, but do some discovery ourselves (for the value of SIGWINCH for example) and export that as a
val sigwinch : int
Worth noting that the default ocaml signal interface accepts arbitrary integers so that would be no issue, also not an issue with Luv.
3. What do we do with signals that are not supported ?
Do we want to fail hard, fail silently or give it a "button" to control the behavior, this is likely very relevant for windows as they have only a small set of signals.
The text was updated successfully, but these errors were encountered: