4 ms·
One of the tricky things about shells is the interaction between fork and pthreads. For example, if you fork while another thread holds a lock, you risk deadloc
by ridiculous_fish 9y ago
One of the tricky things about shells is the interaction between fork and pthreads. For example, if you fork while another thread holds a lock, you risk deadlock.
node uses pthreads for certain asynchronous operations like stat(). How does Closh handle forking when there are multiple threads?
- kloud 9y agoJS is single-threaded by design and node encourages use of asynchronous operations and then runs callbacks on the event loop. Node provides higher-level non-blocking function spawn, so closh currently does not need to do forking directly. I hope this can get us far before the need to drop into lower level and start dealing with threads. I am curious, what does fish use threads for and how does it handle them?