This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Improved ^c support for gdb/guile
- From: Doug Evans <xdje42 at gmail dot com>
- To: Ludovic Courtès <ludo at gnu dot org>
- Cc: Eli Zaretskii <eliz at gnu dot org>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, guile-devel at gnu dot org
- Date: Tue, 18 Feb 2014 09:31:00 -0800
- Subject: Re: [PATCH v2] Improved ^c support for gdb/guile
- Authentication-results: sourceware.org; auth=none
- References: <wrbvbwejihe dot fsf at sspiff dot org> <wrbr471jxjg dot fsf at sspiff dot org> <834n3x8o7m dot fsf at gnu dot org> <CAP9bCMSE+vNpG2nJNKNQk3QfQHV=cqRdEGmv7T3eEcgQ0cTyFQ at mail dot gmail dot com> <83y519788a dot fsf at gnu dot org> <CAP9bCMQiZurfMyU-qA9LEy_6_BOyRE1-dke93_m505EHuNZrAA at mail dot gmail dot com> <871tz0d5vc dot fsf at gnu dot org>
On Tue, Feb 18, 2014 at 3:20 AM, Ludovic Courtès <ludo@gnu.org> 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.