Forum: Ruby-Gnome 2 FileUtils, Threads, and Gtk

Posted by Nikolai Weibull (Guest)
on 2010-06-18 13:36
(Received via mailing list)
Hi!

The following code seems to lock up an never complete on 1.8.7:

require 'gtk2'

Gtk.init_add do
  Thread.start do
    FileUtils.cp 'a', 'b'
    Gtk.main_quit
  end
end

Gtk.main

For any file a.

Using code similar to that shown in

http://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_threadshttp://ruby-gnome2.sourceforge.jp/hiki.cgi?tips_threads

works, but is very slow.

Has anyone encountered similar problems?  Anyone have any experience
with threads and 1.9.1?
Posted by KONTRA, Gergely (Guest)
on 2010-06-18 17:36
(Received via mailing list)
Gtk.main_quit in a Thread?

I don't think it will ever causes a "great success"...
Posted by Nikolai Weibull (Guest)
on 2010-06-19 03:09
(Received via mailing list)
On Fri, Jun 18, 2010 at 17:35, KONTRA, Gergely <pihentagy@gmail.com> 
wrote:
> Gtk.main_quit in a Thread?
>
> I don't think it will ever causes a "great success"...

Don’t top-post and, seriously, that wasn’t the issue here.
Posted by Mike Charlton (Guest)
on 2010-06-19 05:01
(Received via mailing list)
On 19 June 2010 10:08, Nikolai Weibull <now@bitwi.se> wrote:
> On Fri, Jun 18, 2010 at 17:35, KONTRA, Gergely <pihentagy@gmail.com> wrote:
>> Gtk.main_quit in a Thread?
>>
>> I don't think it will ever causes a "great success"...
>
> Don’t top-post and, seriously, that wasn’t the issue here.

Actually, that would have been my first guess too.  What
was the issue?

        MikeC
Posted by Nikolai Weibull (Guest)
on 2010-06-19 11:33
(Received via mailing list)
On Sat, Jun 19, 2010 at 05:01, Mike Charlton <mikekchar@gmail.com> 
wrote:
> On 19 June 2010 10:08, Nikolai Weibull <now@bitwi.se> wrote:
>> On Fri, Jun 18, 2010 at 17:35, KONTRA, Gergely <pihentagy@gmail.com> wrote:
>>> Gtk.main_quit in a Thread?
>>>
>>> I don't think it will ever causes a "great success"...
>>
>> Don’t top-post and, seriously, that wasn’t the issue here.
>
> Actually, that would have been my first guess too.  What
> was the issue?

It doesn’t matter, as it never reaches the Gtk.main_quit, which,
perhaps, should be enqueued in the way described in the article I
mentioned as well.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.