Truffle currently has Java semantics where if the main thread exits, other threads just continue to run. We need the Ruby semantics where the main thread exiting will kill other threads. See the implementation of Thread#kill (in the ThreadNodes class) for a way to do this without any overhead.