3 ms·
This is interesting, but it's not the hard part of exception handling. The next step is doing something to the state of the process that got the exception. If
by Animats 10y ago
This is interesting, but it's not the hard part of exception handling. The next step is doing something to the state of the process that got the exception. If the exception comes from a userspace process, that's OK, because those processes aren't part of the Rust OS. But if the exception comes from kernel code, there's a problem. Rust code has to mess with the internal state of Rust code.
Signals have the same issue in ordinary Rust programs. See [1]. What's the state of the Rust world when you're in a signal handler?
[1] https://github.com/rust-lang/rust/issues/11203 https://github.com/rust-lang/rust/issues/11203
- Manishearth 10y agoThat's a two year old, closed, issue, from when rust had a runtime, probably doesn't apply anymore. I don't think signal handlers are a big deal because global mutable state in rust is rare; and when it exists it probably is immune to the issues -- global mutable state in rust is required to be thread safe (since rust doesn't know if you are using threads), which should make it signal -safe too.
- bogomipz 10y agoNot sure what you mean, doesn't Rust have a runtime now?
- Manishearth 10y agoEverything has a runtime, except perhaps hand-rolled assembly. Rust today has a C-like runtime, which is bare minimum and makes it possible to FFI easily. For the most part you can pretend it doesn't exist; it doesn't affect programs. In the past, Rust did have a bulkier runtime with a green thread scheduler and libuv; a runtime that "mattered".
- nemaar 10y agoIt has a runtime comparable to C. Back in those days, it had a much larger one.
- bogomipz 10y agoOk, that's what I thought : ) It interesting that they stripped down the runtime from previous(larger) iterations. Are those discussion discussed anywhere that you know about? It seems like that would be an interesting read.
- Manishearth 10y agohttps://github.com/rust-lang/rfcs/blob/master/text/0230-remove-runtime.md https://github.com/rust-lang/rfcs/blob/master/text/0230-remo... and the PR/issue linked there. There are also old mailing list discussions on rust-dev somewhere which discuss this IIRC.