[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strange threading behaviour in guile-16.1 (--with-threads) and (gtk-
From: |
Stanislas Pinte |
Subject: |
Re: Strange threading behaviour in guile-16.1 (--with-threads) and (gtk-main): gtk-main blocks all other threads |
Date: |
Fri, 09 Feb 2007 11:09:49 +0100 |
User-agent: |
Thunderbird 1.5.0.9 (Windows/20061207) |
Hello again,
some precisions about precise versions used:
I am on debian, x86, using the following packages:
address@hidden:~/guile/tests$ dpkg -l | grep guile
ii guile-1.6 1.6.8-6 The
GNU extension language and Scheme interp
ii guile-1.6-dev 1.6.8-6
Development files for Guile 1.6
...
ii guile-gnome0-gnome 2.7.99-4
Guile bindings for libgnome
...
ii guile-gnome0-gtk 2.7.99-4
Guile bindings for GTK+, libglade, Pango and
...
address@hidden:~/guile/tests$
Stanislas Pinte a écrit :
> Hello,
>
> I made a short program (see below) to demonstrate the problem:
>
> as soon as I call (gtk-main), all other threads are quickly frozen. From
> another application we have, creating new threads
>
> I now that guile 1.6.1 has strange problems with threads, but this seems
> to me a bit too far, like gtk would lock the complete guile interpreter.
>
> Thanks for any help in advance!
>
> Kind regards,
>
> Stan.
>
> ;;
> ;;some test code for formatting text to a file in a multi-thread environment
> ;;
> ;; This code demonstrates that (gtk-main) function blocks
> ;; (all) other threads.
> ;; No idea why...
>
> (use-modules (ice-9 threads))
> (use-modules (gnome gtk))
>
> (define (async-task2)
> (let ((file (open-output-file "test.txt")))
> (display "mmm\n")
> (do ((i 0 (+ 1 i)))
> ((>= i 100))
> (display "writing a line\n")
> (simple-format file "hep ~A ~%" i))
>
> (close file)
> (display "done\n")))
>
> (make-thread async-task2)
>
> (display "before gtk-main\n")
> (gtk-main)
> (display "after\n")
>
> ; this to prove that guile without GTK doesn't prevent autonomous
> threads to execute.
> ;(do ((i 0 (+ 1 i)))
> ; ((>= i 100))
> ; (display "looping...\n")
> ; (sleep 1))
>
>