In my Python program, I use eventlet to create a lot of greenthreads, just want to know if the current greenthread sleeps, which one of the rest will get scheduled and run? Any scheduler in the eventlet?
Thanks!
In my Python program, I use eventlet to create a lot of greenthreads, just want to know if the current greenthread sleeps, which one of the rest will get scheduled and run? Any scheduler in the eventlet?
Thanks!
Generally speaking, having two greenthreads ready, which one is going to run is undefined. You should write your programs as if it's random choice each time.
Implementation detail is that we have scheduler queue with FIFO semantics. But it gets a little more complicated waiting for time (>0 seconds) or waiting for file descriptors (including network).
Oh and we have official Github repository here https://github.com/eventlet/eventlet