Compiling latest ruby-gnome2 with latest ruby 1.9 - missing rb_thread_t

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 - [email protected] che bisogno ci
    sarebbe
    •           di parlare tanto di amore e di rettitudine? 
      

(Chuang-Tzu)

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. ([email protected]):

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 - [email protected] che bisogno ci
    sarebbe
    •           di parlare tanto di amore e di rettitudine? 
      

(Chuang-Tzu)

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.

Hi,

In [email protected]
“[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” [email protected] 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

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

best,
Dan

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. ([email protected]):

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

Hi,

In [email protected]
“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” [email protected] 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

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 :slight_smile:

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. ([email protected]):

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 - [email protected] che bisogno ci
    sarebbe
    •           di parlare tanto di amore e di rettitudine? 
      

(Chuang-Tzu)

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 ([email protected]):

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

Hi,

In [email protected]
“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” [email protected] 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

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 ([email protected]):

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 - [email protected] 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

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 ([email protected]):

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 - [email protected] che bisogno ci
    sarebbe
    •           di parlare tanto di amore e di rettitudine? 
      

(Chuang-Tzu)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs