Interesting Links [0x04]

This week’s links are all to do with signals. What are signals, and why are they doing in my JVM? Ok, that is a misnomer - firstly signal exists in all POSIX-like OSes, and secondly they affect all applications, the JVM included.

The difference is that the JVM will process signals on behalf of the managed code, compared to a native-compiled language. Imagine if you have dereferenced into a NULL pointer, or performed a divide-by-zero error: in native code, the application crashes. In Java, the application could say, “hey, you’ve got a NullPointerException” or “man, I know you didn’t pass Math in elementary school, but don’t fret, here’s an ArithmeticException for you to play with”. In both cases, managed code allows the end-user to survive events that normally segfaults a native application.

Signal handling can be a world of pain when you’re not careful with the code, assumptions, limitations and invariants that come with them - and there are plenty. Be very familiar with man 7 signals, and read the following links:

Bonus