3 ms·
Good thing C doesn't run the world!
by bradfitz 5y ago
Good thing C doesn't run the world!
- pmarreck 5y agoC doesn't have exceptions?
- d110af5ccf 5y ago... no, it does not. Are you thinking of C++?
- pmarreck 5y agoErm, you can raise signals? And then catch them elsewhere? Or use setjmp and longjmp at least?
- d110af5ccf 5y agosetjmp and longjmp are jumps, not exceptions. But sure, you can use them as part of an error handling strategy that resembles exceptions. It's lower level though. Similarly, goto isn't the same thing as a function call but you can certainly use it to that end. Signals are similarly not exceptions, plus don't they vary significantly between POSIX and other platforms? I don't think Windows (for example) supports user space (ie non-cooperative) preemption. I recall that this caused issues for Go because the authors implement their own lightweight threads in user space.