From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6984 invoked by alias); 11 Jul 2002 23:40:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6969 invoked from network); 11 Jul 2002 23:39:59 -0000 Received: from unknown (HELO corb.mc.mpls.visi.com) (208.42.156.1) by sources.redhat.com with SMTP; 11 Jul 2002 23:39:59 -0000 Received: from grante.comtrol.com (isis.visi.com [209.98.98.8]) by corb.mc.mpls.visi.com (Postfix) with SMTP id CB614819A for ; Thu, 11 Jul 2002 18:39:58 -0500 (CDT) Received: (qmail 4542 invoked by uid 500); 11 Jul 2002 23:43:44 -0000 Date: Thu, 11 Jul 2002 16:53:00 -0000 From: Grant Edwards To: gdb@sources.redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: RDI code busy-waiting on running target? Message-ID: <20020711184343.A4472@visi.com> References: <20020711175854.A29971@visi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vkogqOf2sHV7VnPd" Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20020711175854.A29971@visi.com>; from grante@visi.com on Thu, Jul 11, 2002 at 05:58:56PM -0500 X-SW-Source: 2002-07/txt/msg00257.txt.bz2 --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 553 On Thu, Jul 11, 2002 at 05:58:56PM -0500, Grant Edwards wrote: > I've noticed that gdb uses all the CPU it can get while the > target is running (e.g. busy-waiting 'till target stops). > > I'm building 5.2 to see if it still does that Yup. Here's a patch that fixes it. I only added the usleep() when there's no ui_loop_hook to call. Is that the right thing to do, or will Insight et al still suck CPU time? I'm not sure who's supposed to be surrendering the CPU, the UI or the target. Is usleep() portable? -- Grant Edwards grante@visi.com --vkogqOf2sHV7VnPd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rdi-busy-wait.patch" Content-length: 1296 diff -r -U8 gdb-5.2/gdb/ChangeLog gdb-5.2-mod/gdb/ChangeLog --- gdb-5.2/gdb/ChangeLog Fri Apr 26 20:05:21 2002 +++ gdb-5.2-mod/gdb/ChangeLog Thu Jul 11 18:39:18 2002 @@ -1,8 +1,14 @@ +2002-09-11 Grant Edwards + + * rdi-share/ardi.c: add 10ms sleep (iff there's no + ui_loop_hook) to busy-wait loop when target is + running. + 2002-04-26 GDB Administrator GDB 5.2 Released. * version.in: Update to version 5.2. 2002-04-26 Michal Ludvig * x86-64-tdep.c (x86_64_skip_prologue): Print note when debugging Only in gdb-5.2-mod/gdb: ChangeLog~ diff -r -U8 gdb-5.2/gdb/rdi-share/ardi.c gdb-5.2-mod/gdb/rdi-share/ardi.c --- gdb-5.2/gdb/rdi-share/ardi.c Thu Oct 12 17:56:31 2000 +++ gdb-5.2-mod/gdb/rdi-share/ardi.c Thu Jul 11 18:28:58 2002 @@ -1411,16 +1411,18 @@ interrupt_request = FALSE; stop_request = FALSE; signal(SIGINT, ardi_sigint_handler); while( executing ) { if (ui_loop_hook) ui_loop_hook(0); + else + usleep(10000); if (interrupt_request || stop_request) { interrupt_target(); interrupt_request = FALSE; stop_request = FALSE; } Adp_AsynchronousProcessing( async_block_on_nothing ); --vkogqOf2sHV7VnPd--