From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stan Pinte Newsgroups: gmane.lisp.guile.user Subject: bug in threading implementation, using guile-1.6.1 Date: Tue, 31 Dec 2002 13:44:24 +0100 Organization: Alto Software Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <20021231134424.2faa08ad.alto_stan@wanadoo.be> Reply-To: alto_stan@wanadoo.be NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1041337598 25069 80.91.224.249 (31 Dec 2002 12:26:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 31 Dec 2002 12:26:38 +0000 (UTC) Cc: guile-gtk Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18TLTg-0006WC-00 for ; Tue, 31 Dec 2002 13:26:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18TLRu-0005t5-07 for guile-user@m.gmane.org; Tue, 31 Dec 2002 07:24:46 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18TLQI-0004pO-00 for guile-user@gnu.org; Tue, 31 Dec 2002 07:23:06 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18TLQ9-0004Vh-00 for guile-user@gnu.org; Tue, 31 Dec 2002 07:22:59 -0500 Original-Received: from maho3msx2.corp.emc.com ([128.221.11.32]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18TLOW-0003RC-00 for guile-user@gnu.org; Tue, 31 Dec 2002 07:21:16 -0500 Original-Received: from pablo (10.68.1.38 [10.68.1.38]) by maho3msx2.corp.emc.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id ZGWV64QG; Tue, 31 Dec 2002 07:21:12 -0500 Original-To: guile-user X-Mailer: Sylpheed version 0.8.8 (GTK+ 1.2.10; i686-pc-linux-gnu) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1486 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1486 hello, I am using multiple threads within a guile-gtk application. a call to (gtk-threads-ensure-handler) ensures that a first thread gets started, and allows the rest of my program to execute. At the end of that program, I call (gtk-main), to wait in the Gtk event thread. If I run my program without starting a second thread, it is ok, but as soon as I invoke (gtk-threads-ensure-handler), my CPU is used at 100% NOTES: 1: I configured guile-1.6.1 using the "--with-threads" flag. 2: if I strace my process, I see this: ioctl(7, FIONREAD, [0]) = 0 select(32, [6 7], [], [], {0, 0}) = 1 (in [6], left {0, 0}) gettimeofday({1041338430, 454970}, NULL) = 0 gettimeofday({1041338430, 455055}, NULL) = 0 ioctl(7, FIONREAD, [0]) = 0 select(32, [6 7], [], [], {0, 0}) = 1 (in [6], left {0, 0}) gettimeofday({1041338430, 455767}, NULL) = 0 gettimeofday({1041338430, 455852}, NULL) = 0 ioctl(7, FIONREAD, [0]) = 0 select(32, [6 7], [], [], {0, 0}) = 1 (in [6], left {0, 0}) gettimeofday({1041338430, 456429}, NULL) = 0 gettimeofday({1041338430, 456511}, NULL) = 0 ioctl(7, FIONREAD, [0]) = 0 select(32, [6 7], [], [], {0, 0}) = 1 (in [6], left {0, 0}) gettimeofday({1041338430, 457084}, NULL) = 0 gettimeofday({1041338430, 457166}, NULL) = 0 ioctl(7, FIONREAD, [0]) = 0 select(32, [6 7], [], [], {0, 0}) = 1 (in [6], left {0, 0}) gettimeofday({1041338430, 459008}, NULL) = 0 gettimeofday({1041338430, 459097}, NULL) = 0 ioctl(7, FIONREAD, [0]) = 0 select(32, [6 7], [], [], {0, 0}) = 1 (in [6], left {0, 0}) gettimeofday({1041338430, 459688}, NULL) = 0 gettimeofday({1041338430, 459771}, NULL) = 0 ioctl(7, FIONREAD, [0]) = 0 select(32, [6 7], [], [], {0, 0}) = 1 (in [6], left {0, 0}) and so on.... --> I suspect a bug in the implementation of coop_wait_for_runnable_thread () in libguile/isselect.c if (QFIRST (coop_global_sleepq)->timeoutp) gettimeofday (&now, NULL); return coop_wait_for_runnable_thread_now (&now); ... thanks a lot, Stan -- Stanislas Pinte Computer Consultant Alto Software 20 Pl St Jacques B-4000 Liège web: http://www.altosw.be email: alto_stan@wanadoo.be _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user