emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using glib's g_file_monitor_file and g_file_monitor_directory


From: Paul Eggert
Subject: Re: Using glib's g_file_monitor_file and g_file_monitor_directory
Date: Tue, 28 May 2013 12:32:05 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 05/28/13 09:59, Eli Zaretskii wrote:
> E.g., we could use glib or
> whatever for converting process notifications into readable events,
> but if that library uses signals internally, our code still can be
> interrupted by signals, right?

Yes and no.  The glib SIGCHLD handler is async-signal-safe,
modifying only data that's private to glib and without doing anything
dangerous like malloc.  So Emacs's code can still be interrupted by
signals, but the only symptoms visible to Emacs should be that
syscalls will occasionally fail with errno==EINTR; this is
a bit of a hassle, but it's one we've by-and-large solved and is
a relatively minor issue compared to the potential races
that still plague Emacs's internals.

Currently, Emacs's child-watcher procedure is done inside
Emacs's SIGCHLD handler (in handle_child_signal).  But if we
let glib handle SIGCHLD, glib already has a table of child
processes it's waiting for and glib reaps the children,
so handle_child_signal needs to be partly bypassed.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]