3 ms·
Does anyone know what Ruby 1.9 does for creating threads? Does it do something similar to what the author does, or something else entirely?
by scott_s 18y ago
Does anyone know what Ruby 1.9 does for creating threads? Does it do something similar to what the author does, or something else entirely?
- ice799 18y agoHi. Author here. Ruby 1.9 uses libpthread which creates stacks for its threads in a similar way (mmap and a guard page).
- scott_s 18y agoYou mean it calls pthread_create for every Ruby thread? That would mean threads are no longer green threads, since both of the widely used Pthread libraries on Linux (Linuxthreads on 2.4 versions of the kernel, and NTPL on 2.6) have a 1-to-1 mapping of POSIX threads to kernel threads.
- ice799 18y agocorrect. but they each take a global interpreter lock ensuring only one is executing at any given time.