[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: block_input for some APIs
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: block_input for some APIs |
Date: |
Tue, 13 Dec 2016 09:13:40 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Mon, 12 Dec 2016 16:48:53 -0500, Stefan Monnier <address@hidden> said:
>>> Does anyone remember why we block input around calls to functions like
>>> getpwnam or tzset or fwrite?
>> I think this dates back to when C-g and/or other handlers called
>> longjmp.
> I'm not completely sure, but my own impression is that this dates back
> to before SYNC_INPUT, i.e. with input became available, we'd get an IO
> signal and in the handler we'd run a whole bunch of code, since
> reentrance was a big issue. Nowadays we delay this async processing to
> the next QUIT so there's no re-entrance issue any more.
I added some of them around early 2007, when SYNC_INPUT was not used
by default. These functions call malloc etc. internally (at least on
Darwin), so it was not safe to call read_socket_hook, which also calls
malloc etc., from SIGIO/SIGALRM handler while processing getpwnam etc.
YAMAMOTO Mitsuharu
address@hidden