4 ms·
Yeah, it’d be interesting to see the Rust code contrasted with correct C versions. How does the C code deal with a monitor being unplugged? I wonder if it could
by DougBTX 6y ago
Yeah, it’d be interesting to see the Rust code contrasted with correct C versions. How does the C code deal with a monitor being unplugged? I wonder if it could be shuffled around to amount to an early return with an Unplugged error.
- vbezhenar 6y agoIf I understood it correctly, monitor doesn't really go away in your event handler, so C code don't have to deal with that.
- cycloptic 6y agoIn C, you're supposed to listen for a "destroy" event on the output and then in the handler you would delete all your references to the object. I would be interested to know if any language has a way to statically analyze this, instead of using a monad.