What is a greenlet and how does it work?
masterA greenlet is a small, independent pseudo-thread represented by a greenlet object. Conceptually, it is a stack of frames where the bottom frame is the initial function called and the innermost frame is where the greenlet is currently paused.
Greenlets allow for explicit execution switching (jumping between stacks). Unlike threads, jumps are never implicit; a greenlet must explicitly choose to switch to another greenlet, causing the former to suspend and the latter to resume. Switching can also pass objects between greenlets, similar to generator.send(val).