[#15707] Schedule for the 1.8.7 release — "Akinori MUSHA" <knu@...>

Hi, developers,

21 messages 2008/03/01

[#15740] Copy-on-write friendly garbage collector — Hongli Lai <hongli@...99.net>

Hi.

31 messages 2008/03/03
[#15742] Re: Copy-on-write friendly garbage collector — Yukihiro Matsumoto <matz@...> 2008/03/03

Hi,

[#15829] Re: Copy-on-write friendly garbage collector — Daniel DeLorme <dan-ml@...42.com> 2008/03/08

Yukihiro Matsumoto wrote:

[#15756] embedding Ruby 1.9.0 inside pthread — "Suraj Kurapati" <sunaku@...>

Hello,

18 messages 2008/03/03
[#15759] Re: embedding Ruby 1.9.0 inside pthread — Nobuyoshi Nakada <nobu@...> 2008/03/04

Hi,

[#15760] Re: embedding Ruby 1.9.0 inside pthread — Yukihiro Matsumoto <matz@...> 2008/03/04

Hi,

[#15762] Re: embedding Ruby 1.9.0 inside pthread — "Suraj N. Kurapati" <sunaku@...> 2008/03/04

Yukihiro Matsumoto wrote:

[#15783] Adding startup and shutdown to Test::Unit — Daniel Berger <Daniel.Berger@...>

Hi all,

15 messages 2008/03/04

[#15835] TimeoutError in core, timeouts for ConditionVariable#wait — MenTaLguY <mental@...>

I've been reworking JRuby's stdlib to improve performance and fix

10 messages 2008/03/09

[#15990] Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...>

Hi,

35 messages 2008/03/23
[#15991] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/23

[#15993] Re: Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...> 2008/03/23

Hi Dave,

[#15997] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/23

[#16024] Re: Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...> 2008/03/26

Hi Dave,

[#16025] Re: Recent changes in Range#step behavior — Yukihiro Matsumoto <matz@...> 2008/03/26

Hi,

[#16026] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16027] Re: Recent changes in Range#step behavior — Yukihiro Matsumoto <matz@...> 2008/03/26

Hi,

[#16029] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16030] Re: Recent changes in Range#step behavior — Yukihiro Matsumoto <matz@...> 2008/03/26

Hi,

[#16031] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16032] Re: Recent changes in Range#step behavior — "Vladimir Sizikov" <vsizikov@...> 2008/03/26

On Wed, Mar 26, 2008 at 7:01 PM, Dave Thomas <dave@pragprog.com> wrote:

[#16033] Re: Recent changes in Range#step behavior — Dave Thomas <dave@...> 2008/03/26

[#16041] Re: Recent changes in Range#step behavior — David Flanagan <david@...> 2008/03/26

Dave Thomas wrote:

Re: embedding Ruby 1.9.0 inside rb_thread_create()

From: ts <decoux@...>
Date: 2008-03-29 16:02:55 UTC
List: ruby-core #16070
Suraj N. Kurapati wrote:
> Thanks!  I made this correction and the example proceeds further.

 best to look at ruby.c to know how to call it

vgs% diff -u main.c~ main.c
--- main.c~	2008-03-29 16:45:01.000000000 +0100
+++ main.c	2008-03-29 16:59:56.000000000 +0100
@@ -88,9 +88,9 @@

     printf("R: BEGIN (synchronized with C)\n");

-    // printf("R: ");
-    // fflush(stdout);
-    // rb_eval_string("p :current => Thread.current, :main =>
Thread.main");
+    printf("R: ");
+    fflush(stdout);
+    rb_eval_string("p :current => Thread.current, :main => Thread.main");

     // body of this ruby thread is effectively defined in an external file
     rb_require("hello.rb");
@@ -121,8 +121,13 @@
     ruby_init_loadpath();

     #ifdef HAVE_RUBY_19
+    {
+	VALUE gem;
         printf("C: Init_prelude()\n");
-        Init_prelude();
+	gem = rb_define_module("Gem");
+	rb_const_set(gem, rb_intern("Enable"), Qtrue);
+	Init_prelude();
+    }
     #endif

     printf("C: create synchronization mailboxes\n");
vgs%

vgs% sh make.sh
ruby 1.9.0 (2008-03-28 revision 15850) [i686-linux]
checking for ruby_init() in -lruby... no
checking for ruby_init() in -lruby-static... yes
creating Makefile
gcc -I. -I/home/ts/local/r19d/include/ruby-1.9.0/i686-linux
-I/home/ts/local/r19d/include/ruby-1.9.0 -I. -D_FILE_OFFSET_BITS=64
-fPIC -g   -o main.o -c main.c
gcc  -o main.so main.o -L. -L/home/ts/local/r19d/lib
-Wl,-R/home/ts/local/r19d/lib -L.  -rdynamic -Wl,-export-dynamic
-lruby-static  -lpthread -lrt -ldl -lcrypt -lm   -lc
C: RUBY_INIT_STACK
C: ruby_init()
C: ruby_init_loadpath()
C: Init_prelude()
C: create synchronization mailboxes
C: rb_thread_create()
C: relay to Ruby -- begin
C: wake up Ruby
C: wait for Ruby
R: BEGIN (ad-hoc from rb_thread_create())
R: wait for C
R: BEGIN (synchronized with C)
R: {:current=>#<Thread:0xb7cc7efc run>, :main=>#<Thread:0xb7cdaef8 sleep>}
/home/ts/yyy/embed-ruby-1.9-thread/hello.rb: delay 1
/home/ts/yyy/embed-ruby-1.9-thread/hello.rb: delay 2
/home/ts/yyy/embed-ruby-1.9-thread/hello.rb: delay 3
R: relay to C -- begin
R: wake up C
R: wait for C
C: relay to Ruby -- end
C: relay to Ruby -- begin
C: wake up Ruby
R: relay to C -- end
R: wake up C
R: END
C: wait for Ruby
C: relay to Ruby -- end
C: Thread.list => [#<Thread:0xb7cdaef8 run>]
C: ruby_finalize()
C: exit
vgs%


Guy Decoux

In This Thread

Prev Next