# green_threads **Repository Path**: changser/green_threads ## Basic Information - **Project Name**: green_threads - **Description**: C++ Green threads and coroutines library - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README green_threads ============= C++ Green threads and coroutines library **Motivation:** * Write faster multithreaded programs by utilizing reduced context switch time. * Write shorter and more elegant programs by using the yield functionality that is modeled after the python yield keyword and co-routines. **Getting started:** look at the very short [api](https://github.com/yigalirani/green_threads/blob/master/green_threads.h) and [example program](https://github.com/yigalirani/green_threads/blob/master/green_threads_test.cpp) **Future development:** * Integrate the library with IO functionality like sockets and files * Further improve speed . * Add dynamic number of green threads. * Port to non msvc/windows compilers and operating systems. * Port to non-x86 processors such as arm. **How does it work:** The library explicitly allocate runtime stack for each green thread. The gt_yield function switches the current green thread by manipulating, using assembler, the esp and ebp registers who point the current runtime stack.