# Compiling latest ruby-gnome2 with latest ruby 1.9 - missing	rb\_thread\_t

**URL:** <https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082>\
**Category:** Ruby-Gnome 2\
**Created:** [December 24, 2007, 1:35pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082 "2007-12-24T13:35:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 24, 2007, 1:35pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/1 "2007-12-24T13:35:36Z")

</div>

Good day. I am trying to check the performance of the latest releases  
of Ruby 1.9, and for most of my work I need GTK/Glib.

When compiling Glib, an error is raised while compiling  
rbglib\_mainloop.c:

rbglib\_mainloop.c:106: error: expected declaration specifiers or  
e$B!Fe(B…e$B!Ge(B before e$B!Fe(Brb\_thread\_te$B!Ge(B

I looked at the ruby sources: the only place where rb\_thread\_t is  
defined is in vm\_core.h, which is not exported to the area where  
include files. The threading core has changed (this is one of the main  
reasons for me to test the latest ruby code). Threads now must be  
handled with routines described in intern.h.

Has some of the developers updated the code? I searched the list  
without success.

I will now leave for a couple of hours. In the afternoon, I will make  
an attempt myself, although I have limited understanding of how  
threading is handles inside glib.

Best

Carlo

–

- 

```
    Se la Strada e la sua Virtu' non fossero state messe da 

```

parte,

- K \* Carlo E. Prelz - removed\_email\_address@domain.invalid che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 24, 2007, 10:30pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/2 "2007-12-24T22:30:19Z")

</div>

Subject: Re: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2  
with?latest ruby 1.9 - miss  
Date: lun 24 dic 07 09:32:04 +0100

Quoting Nathan V. (removed\_email\_address@domain.invalid):

> can you please look at subject [ANN] Ruby-GNOME2 Win32 GUI Installer and  
> give your suggestion to install ruby-genome2. Struggling to get it  
> installed in my w2k pc.

I am afraid I cannot help you - I live in a windows-free world.

Carlo

–

- 

```
    Se la Strada e la sua Virtu' non fossero state messe da 

```

parte,

- K \* Carlo E. Prelz - removed\_email\_address@domain.invalid che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 25, 2007, 12:54am UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/3 "2007-12-25T00:54:03Z")

</div>

Carlo E. Prelz wrote:

> Subject: Re: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
I made some progress. you can see under that subject. thanks.

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 27, 2007, 2:56pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/4 "2007-12-27T14:56:13Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with latest ruby  
1.9 - missing rb\_thread\_t” on Mon, 24 Dec 2007 11:35:37 +0100,  
“Carlo E. Prelz” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Good day. I am trying to check the performance of the latest releases  
> of Ruby 1.9, and for most of my work I need GTK/Glib.

> Has some of the developers updated the code? I searched the list  
> without success.

The thread model of ruby 1.9.0 is different with ruby  
1.8.x. (ruby 1.9.0 doesn’t use poll() based thread  
scheduling.) So we need to use different approach. In my  
estimation, codes for ruby 1.9.0 is more simpler rather than  
for ruby 1.8.x.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 30, 2007, 10:11am UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/5 "2007-12-30T10:11:30Z")

</div>

Ktou seems to have got this working in the latest SVN. Thanks Ktou!

best,  
Dan

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 30, 2007, 8:43pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/6 "2007-12-30T20:43:14Z")

</div>

Subject: Re: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with  
latest ruby 1.9 - missing rb\_thread\_t  
Date: dom 30 dic 07 10:11:30 +0100

Quoting Daniel L. (removed\_email\_address@domain.invalid):

> Ktou seems to have got this working in the latest SVN. Thanks Ktou!

He deserves lots of thanks indeed.

I am attaching a small patch with still a few changes that I needed  
for having a complete compile (including addition of ref/unref for  
widgets, that I needed for an old project - I can’t remember why).

The patch also includes the fixing of a little bug:

— glib/src/rbgutil\_callback.c (revisione 2746)  
+++ glib/src/rbgutil\_callback.c (copia locale)  
@@ -91,7 +91,7 @@  
\* and it’s guaranteed that the needed mutexes are initialized  
\*/  
FD\_ZERO(&read\_fds);  
FD\_SET(callback\_fd[0], &read\_fds);

- 

```
   rb_thread_select(2, &read_fds, NULL, NULL, NULL);

```

- 

```
   rb_thread_select(callback_fd[0]+1, &read_fds, NULL, NULL, 

```

NULL);

```
     {
         ssize_t size;

```

Here the code was passing 2 as ‘max’ to rb\_thread\_select, but this  
value is then passed as first parameter to select, and that parameter,  
as read in the manpage of select, should be “the highest-numbered file  
descriptor in any of the three sets, plus 1”.

Anyway: I am also attaching a small test program, called locktest.rb,  
a very short subset of a program of mine. If you run it, and press the  
‘test me’ button, you will get a file selection menu.

Now select a file (or press Cancel). You will return to the ‘test me’  
button. Press it a second time. This time, the program will hang.

I suspect there is some kind of lock concurrence. You need to kill the  
process with signal 9 to make it stop.

This happens with Linux on a core 2 duo laptop (64bit), using both  
ruby and ruby-gnome2 from svn (glib/gtk from debian sid).

I hope the maintainers can replicate my locked condition…

Carlo

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 31, 2007, 8:48am UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/7 "2007-12-31T08:48:06Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with latest  
ruby 1.9 - missing rb\_thread\_t” on Sun, 30 Dec 2007 19:18:49 +0100,  
“Carlo E. Prelz” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am attaching a small patch with still a few changes that I needed  
> for having a complete compile (including addition of ref/unref for  
> widgets, that I needed for an old project - I can’t remember why).

I applied your changes without ref/unref and  
Ruby/GStreamer. Thanks. If we need to use ref/unref, that is  
a bug. We should fix the bug instead of exporting ref/unref.

Ruby/GStreamer is in progress. Supporting ruby 1.9.0 is the  
next work.

> Anyway: I am also attaching a small test program, called locktest.rb,  
> a very short subset of a program of mine. If you run it, and press the  
> ‘test me’ button, you will get a file selection menu.
> 
> Now select a file (or press Cancel). You will return to the ‘test me’  
> button. Press it a second time. This time, the program will hang.

In my environment, it seems that the problem is  
fixed. Anyway, I may change rbgutil\_callback.c  
mechanism. But the time will not be came until  
Ruby/GStreamer is done.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 30, 2007, 10:12pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/8 "2007-12-30T22:12:07Z")

</div>

> > Ktou seems to have got this working in the latest SVN. Thanks Ktou!

> He deserves lots of thanks indeed.

I agree, but I think we should address to him as kou instead of Ktou 🙂

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 31, 2007, 12:18pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/9 "2007-12-31T12:18:02Z")

</div>

Subject: Re: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with  
latest ruby 1.9 - missing rb\_thread\_t  
Date: lun 31 dic 07 04:47:45 +0900  
Sorry for the delay!

Quoting Kouhei S. (removed\_email\_address@domain.invalid):

> Ruby/GStreamer is in progress. Supporting ruby 1.9.0 is the  
> next work.

Thanks very much for your answer, and for what you are doing. I have  
no hurry at all.

I will regularly check the svn repository, but you may want to let me  
know  
if some changes are committed which I could repeat my tests with.

Happy new year

Carlo

–

- 

```
    Se la Strada e la sua Virtu' non fossero state messe da 

```

parte,

- K \* Carlo E. Prelz - removed\_email\_address@domain.invalid che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [January 2, 2008, 10:46am UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/10 "2008-01-02T10:46:19Z")

</div>

Subject: Re: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with  
latest ruby 1.9 - missing rb\_thread\_t  
Date: Mon 31 Dec 07 10:18:15AM +0100

Quoting Carlo E. Prelz (removed\_email\_address@domain.invalid):

> I will regularly check the svn repository,

With the latest checkout, my problem disappeared! Thanks a lot.

I am attaching a small patch to substitute the need for ftools.rb  
(during installing) with that for fileutils.rb - the first one has  
been removed from the official ruby distribution.

Carlo

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [January 3, 2008, 4:03am UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/11 "2008-01-03T04:03:52Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with latest  
ruby 1.9 - missing rb\_thread\_t” on Wed, 2 Jan 2008 09:47:06 +0100,  
“Carlo E. Prelz” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am attaching a small patch to substitute the need for ftools.rb  
> (during installing) with that for fileutils.rb - the first one has  
> been removed from the official ruby distribution.

Thanks for reporting.  
I used ruby -run -e install … not fileutils.rb.

–  
kou

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 24, 2007, 9:32pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/12 "2007-12-24T21:32:04Z")

</div>

Carlo E. Prelz wrote:

> Subject: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with latest  
> ruby 1.9 - missing?rb\_thread\_t  
> Date: lun 24 dic 07 11:35:37 +0100
> 
> Quoting Carlo E. Prelz (removed\_email\_address@domain.invalid):
> 
> > I will now leave for a couple of hours. In the afternoon, I will make  
> > an attempt myself, although I have limited understanding of how  
> > threading is handles inside glib.
> 
> I tried the whole afternoon to see if I could come out head-first from  
> this attempt of mine. No way. It is a mystery to me how  
> source\_prepare\_add\_poll\_fd, source\_prepare\_setup\_poll\_fd and friends  
> should be modified.
> 
> Should I knock at the ruby mailing list?
> 
> Merry xmas
> 
> Carlo
> 
> –
> 
> - 
> 
> ```
> Se la Strada e la sua Virtu' non fossero state messe da 
> 
> ```
> 
> parte,
> 
> - K \* Carlo E. Prelz - removed\_email\_address@domain.invalid che bisogno ci  
> sarebbe
> - 
> 
> ```
> di parlare tanto di amore e di rettitudine? 
> 
> ```
> 
> (Chuang-Tzu)

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  
Hi Carlo,  
can you please look at subject [ANN] Ruby-GNOME2 Win32 GUI Installer and  
give your suggestion to install ruby-genome2. Struggling to get it  
installed in my w2k pc.

Thanks Nathan

---

<div class="post-metadata">

**Author:** ![Carlo\_ESPrelz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f07891/32.png) [@Carlo\_ESPrelz](https://www.ruby-forum.com/u/Carlo_ESPrelz)\
**Post date:** [December 24, 2007, 8:06pm UTC](https://www.ruby-forum.com/t/compiling-latest-ruby-gnome2-with-latest-ruby-1-9-missing-rb-thread-t/124082/13 "2007-12-24T20:06:59Z")

</div>

Subject: [ruby-gnome2-devel-en] Compiling latest ruby-gnome2 with latest  
ruby 1.9 - missing?rb\_thread\_t  
Date: lun 24 dic 07 11:35:37 +0100

Quoting Carlo E. Prelz (removed\_email\_address@domain.invalid):

> I will now leave for a couple of hours. In the afternoon, I will make  
> an attempt myself, although I have limited understanding of how  
> threading is handles inside glib.

I tried the whole afternoon to see if I could come out head-first from  
this attempt of mine. No way. It is a mystery to me how  
source\_prepare\_add\_poll\_fd, source\_prepare\_setup\_poll\_fd and friends  
should be modified.

Should I knock at the ruby mailing list?

Merry xmas

Carlo

–

- 

```
    Se la Strada e la sua Virtu' non fossero state messe da 

```

parte,

- K \* Carlo E. Prelz - removed\_email\_address@domain.invalid che bisogno ci  
sarebbe
  - 

```
          di parlare tanto di amore e di rettitudine? 

```

(Chuang-Tzu)
