Re:You might want async in your project
by insanitybit on Sunday September 10, 2023 @02:18PM
(#37458489)
I assume that Ruby does in fact have yield points in some form, such as a global lock. Killing a thread is only possible (for a pthread) via the `pthread_cancel` API. That API is very dangerous and is generally not something you'd ever want to use manually - the thread will not clean up any memory or other resources, any shared memory is left in a tricky state.
To gracefully shut a thread down you need yielding of some kind.
To gracefully shut a thread down you need yielding of some kind.