From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2468 invoked by alias); 31 Dec 2002 12:21:26 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 2451 invoked from network); 31 Dec 2002 12:21:25 -0000 Received: from unknown (HELO maho3msx2.corp.emc.com) (128.221.11.32) by 209.249.29.67 with SMTP; 31 Dec 2002 12:21:25 -0000 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 Date: Tue, 31 Dec 2002 04:21:00 -0000 From: Stan Pinte To: guile-user Cc: guile-gtk Subject: bug in threading implementation, using guile-1.6.1 Message-Id: <20021231134424.2faa08ad.alto_stan@wanadoo.be> Reply-To: alto_stan@wanadoo.be Organization: Alto Software Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-q4/txt/msg00027.txt.bz2 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