From: shibata.hiroshi@... Date: 2014-01-30T06:16:26+00:00 Subject: [ruby-core:60258] [ruby-trunk - Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine Issue #2294 has been updated by Hiroshi SHIBATA. Target version changed from 2.1.0 to current: 2.2.0 ---------------------------------------- Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine https://bugs.ruby-lang.org/issues/2294#change-44734 * Author: Suraj Kurapati * Status: Assigned * Priority: High * Assignee: Koichi Sasada * Category: core * Target version: current: 2.2.0 ---------------------------------------- =begin Hi, I am attaching a "ruby_bind_stack.patch" patch file that adds a ruby_bind_stack() function to the Ruby C API. This function allows me to inform the GC about the stack boundaries of the coroutine inside which Ruby is embedded: void ruby_bind_stack(void *lower, void *upper); I am also attaching tarballs containing code examples that embed Ruby inside two different coroutine environments: UNIX System V contexts[1] and libpcl[2] coroutines. Each tarball has an "output.log" file which contains the result of running `script -c ./run.sh output.log` on my machine: Linux yantram 2.6.31-ARCH #1 SMP PREEMPT Tue Oct 13 13:36:23 CEST 2009 i686 Intel(R) Pentium(R) D CPU 3.00GHz GenuineIntel GNU/Linux The last section in "output.log" corresponds to Ruby @ SVN trunk that is patched with the "ruby_bind_stack.patch" patch file that is attached to this issue. Thanks for your consideration. [1]: http://www.gnu.org/s/libc/manual/html_node/System-V-contexts.html [2]: http://www.xmailserver.org/libpcl.html See also: * http://redmine.ruby-lang.org/issues/show/2258 * http://redmine.ruby-lang.org/issues/show/2126 =end ---Files-------------------------------- ruby_bind_stack.patch (2.66 KB) ruby-ucontext-static-stack.tgz (10 KB) ruby-ucontext-dynamic-stack.tgz (10.2 KB) ruby-libpcl-static-stack.tgz (10.3 KB) ruby-libpcl-dynamic-stack.tgz (10 KB) ruby_bind_stack.patch (2.67 KB) ruby_bind_stack.patch (5 KB) ruby-ucontext-thread.tgz (54.2 KB) ruby-libpcl-thread.tgz (53.3 KB) ruby_bind_stack.patch (4.98 KB) ruby_bind_stack.patch (5.47 KB) ruby_bind_stack.patch (5.45 KB) ruby_bind_stack.patch (5.46 KB) ruby_bind_stack.patch (5.4 KB) ruby_bind_stack_after_refactoring.patch (3.06 KB) ruby_bind_stack.patch (5.72 KB) ruby_bind_stack_after_refactoring.patch (3.37 KB) ruby_bind_stack.patch (5.76 KB) ruby_bind_stack_after_refactoring.patch (3.42 KB) ruby_bind_stack_r25604.patch (3.78 KB) example-pthread-static.tgz (55 KB) example-pthread-static.tgz (55 KB) example-pthread-malloc.tgz (55.5 KB) ruby_bind_stack_r28007.patch (3.78 KB) ruby_bind_stack_r28972.patch (3.78 KB) ruby_bind_stack_1.9.2p0.patch (3.78 KB) -- http://bugs.ruby-lang.org/