sunaku / ruby-coroutine-example Goto Github PK
View Code? Open in Web Editor NEWHow to embed Ruby inside C coroutines.
Home Page: https://bugs.ruby-lang.org/issues/2294
How to embed Ruby inside C coroutines.
Home Page: https://bugs.ruby-lang.org/issues/2294
This example shows how to embed Ruby using different C coroutine libraries: * libpcl http://www.xmailserver.org/libpcl.html * pthread https://computing.llnl.gov/tutorials/pthreads/ * ucontext http://www.gnu.org/s/libc/manual/html_node/System-V-contexts.html That are initialized using two distinct stack allocation methods: * static The coroutine stack is baked into the shared object file. * dynamic The coroutine stack is allocated dynamically, at runtime. And optionally using my ruby_bind_stack() patch for Ruby 1.9.x, if present: * https://github.com/sunaku/ruby/compare/trunk...2294_bind_stack.patch * http://bugs.ruby-lang.org/issues/show/2294 ****************************************************************************** * NOTE: Without the above patch, this example WILL FAIL for Ruby 1.9.x! * ****************************************************************************** To run this example, use the provided `run.sh` script: sh run.sh # displays usage info sh run.sh pcl static ~/.rvm/rubies/* sh run.sh pcl dynamic ~/.rvm/rubies/* sh run.sh pthread static ~/.rvm/rubies/* sh run.sh pthread dynamic ~/.rvm/rubies/* sh run.sh ucontext static ~/.rvm/rubies/* sh run.sh ucontext dynamic ~/.rvm/rubies/* I hope this helps you learn how to embed Ruby inside C coroutines. Enjoy!
Your repository's description includes https://redmine.ruby-lang.org/issues/2294
, but it is invalid now.
Please use https://bugs.ruby-lang.org/issues/2294
instead.
See ruby/b.r-l.o#68 for more detail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.