From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30556 invoked by alias); 18 Feb 2014 17:31:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 30546 invoked by uid 89); 18 Feb 2014 17:31:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f170.google.com Received: from mail-yk0-f170.google.com (HELO mail-yk0-f170.google.com) (209.85.160.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 18 Feb 2014 17:31:02 +0000 Received: by mail-yk0-f170.google.com with SMTP id 9so34216768ykp.1 for ; Tue, 18 Feb 2014 09:31:00 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.236.172.33 with SMTP id s21mr25642481yhl.71.1392744660751; Tue, 18 Feb 2014 09:31:00 -0800 (PST) Received: by 10.170.130.14 with HTTP; Tue, 18 Feb 2014 09:31:00 -0800 (PST) In-Reply-To: <871tz0d5vc.fsf@gnu.org> References: <834n3x8o7m.fsf@gnu.org> <83y519788a.fsf@gnu.org> <871tz0d5vc.fsf@gnu.org> Date: Tue, 18 Feb 2014 17:31:00 -0000 Message-ID: Subject: Re: [PATCH v2] Improved ^c support for gdb/guile From: Doug Evans To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Cc: Eli Zaretskii , "gdb-patches@sourceware.org" , guile-devel@gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00571.txt.bz2 On Tue, Feb 18, 2014 at 3:20 AM, Ludovic Court=E8s wrote: > Right, when Guile is built with pthread support, it has a signal > delivery thread. The actual SIGINT handler ('take_signal' in scmsigs.c) > just write one byte to a pipe; the signal delivery thread reads from > that pipe, and queues an async in the destination thread for later > execution. > >> I'll let guile-devel take over at this point - I understand the code, >> but may miss something noteworthy. >> There is code in scmsigs.c to handle the non-pthread case but it's not >> clear how much is exported nor how well it works. > > The non-pthread code is used when Guile is built without pthread > support. In that case, the async is queued directly from the signal > handler. > > (I think we should aim to get rid of the signal-delivery thread > eventually, and I remember Mark mentioned it before too.) Note that Python queues the asyncs directly from the signal handler, even when it has thread support. I'm not sure if there are any problems in Python's implementation; asyncs can be queued from any thread but only the main thread runs them. Guile would need to come up with its own implementation of course; plus Guile can direct signals to any thread.