Greeny
Greeny is a C++ Green threads and coroutines library
Install / Use
/learn @nifigase/GreenyREADME
Greeny
Greeny is a C++ Green threads and coroutines library
This is a complete rewrite of https://github.com/yigalirani/green_threads library.
Advantages over original library
- Multiple platforms are supported. Original library was hardly bound to MS VisualStudio on i386.
- Fully object-oriented design with no global variables - this allows using green threads in multithreaded programs. You may have multiple green thread sets (contexts) in multiple threads.
- Arbitrary callback types (functors, callable objects, etc.)
- Variable stack sizes - you may set allocated stack size for each green thread.
- next() function without "tid" parameter to get a posted value of any other thread.
Motivation (same as in original library):
- 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 and example program
Future development:
- Automatically grow stack sizes if stacks are nearly exhausted
Requirements
- C++11-compatible compiler
- boost libraries (Used: ptr_containers)
Building Build test using CMake:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=DEBUG ..
- make
Platforms
- GCC on AMD64
- GCC on i386
Related Skills
node-connect
342.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
85.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
342.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
