I am trying to understand the way Gevent/Greenlet chooses the next greenlet to be run. Threads use the OS Scheduler. Go Runtime uses 2 hierarchical queues.
By default, Gevent uses libevent to its plumbling. But how do libevent chooses the next greenlet to be ran, if many are ready to?
Is it random?
I already had read their docs and had a sight on the sourcecode. Still do not know.
Updated: Text changed to recognize that Gevent uses libevent. The question still applies over libevent.