From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30311 invoked by alias); 29 Nov 2006 12:41:04 -0000 Received: (qmail 30250 invoked by uid 22791); 29 Nov 2006 12:40:59 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-vbr8.xs4all.nl (HELO smtp-vbr8.xs4all.nl) (194.109.24.28) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Nov 2006 12:40:52 +0000 Received: from webmail.xs4all.nl (dovemail1.xs4all.nl [194.109.26.3]) by smtp-vbr8.xs4all.nl (8.13.8/8.13.8) with ESMTP id kATCem63064131 for ; Wed, 29 Nov 2006 13:40:48 +0100 (CET) (envelope-from mark.kettenis@xs4all.nl) Received: from 193.137.208.250 (SquirrelMail authenticated user sibelius) by webmail.xs4all.nl with HTTP; Wed, 29 Nov 2006 13:40:49 +0100 (CET) Message-ID: <6734.193.137.208.250.1164804049.squirrel@webmail.xs4all.nl> In-Reply-To: <20061129052942.GA16029@nevyn.them.org> References: <20061129052942.GA16029@nevyn.them.org> Date: Wed, 29 Nov 2006 12:41:00 -0000 Subject: Re: Single stepping and threads From: "Mark Kettenis" To: gdb@sourceware.org User-Agent: SquirrelMail/1.4.8 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00217.txt.bz2 > Ulrich's message earlier reminded me of something I've been meaning to > discuss for a while. This isn't specific to software single stepping, > but to single step in general for threaded programs. > > We have a knob "set scheduler-locking". It offers three values: > > Set mode for locking scheduler during execution. > off == no locking (threads may preempt at any time) > on == full locking (no thread except the current thread may run) > step == scheduler locked during every single-step operation. > In this mode, no other thread may run during a step command. > Other threads may run while stepping over a function call > ('next'). > > The default is "off". Should it be "step" instead? The example I used > to use whenever someone asked me about this was single stepping through > something like a barrier or mutex; if other threads don't run, you > won't advance, because no other thread will have a chance to release > the lock. That much is true. But it seems like a reasonable thing to > document and reference "set scheduler-locking". And having threads > run during single stepping has surprised a lot of users who've asked > me about the current behavior. > > What do you all think? Are you talking about stepi or step? For step we should be very careful, since on some platforms the dynamic linker may play games with locks and we risk a deadlock if we don't let the other threads run.