From: Suraj Kurapati Date: 2009-11-19T04:30:49+09:00 Subject: [ruby-core:26816] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine Issue #2294 has been updated by Suraj Kurapati. Hi, Nobu Nakada wrote: > Switching stack using setcontext() can't work on all platforms. > For instance, on NetBSD and older LinuxThread stack address is > tightly bound to thread, and can't be changed. That is, your > strategy is not portable. You are referring only to my System V context example, right? If so, please note that I also provided a second example that uses libpcl[1] which "can use either the ucontext.h functionalities... or the standard longjmp()/setjmp()" and "is easily portable on almost every Unix system and on Windows" [1]. I will create a thrid example that uses libpthread to demonstrate how this patch lets you embed Ruby 1.9 inside a pthread. (Note that this patch has already allowed Mr. Roman to embed Ruby 1.9 inside a pthread.) > Why don't you simply use a thread instead? Do you mean embedding Ruby inside a pthread? Thanks for your consideration. [1]: http://www.xmailserver.org/libpcl.html ---------------------------------------- http://redmine.ruby-lang.org/issues/show/2294 ---------------------------------------- http://redmine.ruby-lang.org