emacs-devel
[Top][All Lists]
Advanced

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

Re: address@hidden: Emacs 22.1 hung after delete-process]


From: dhruva
Subject: Re: address@hidden: Emacs 22.1 hung after delete-process]
Date: Thu, 16 Aug 2007 22:34:39 +0530

Hi,
 I am going through the reader_thread() in w32proc.c. There is a loop
in which _sys_read_ahead OR _sys_wait_accept is called. I am
suspecting the thread gets into a blocking read (for _sys_read_ahead).
 Could this be causing a hang as the reader_thread is trying to read
from a process that has been killed?
 Making _sys_read_ahead call ReadFile() with OVERLAPPED structure
could allow us implement a cancel able IO. If the process is killed,
we can set an event which will make the ReadFile() return. So, the
thread calling reader_thread() can gracefully exit instead of calling
a TerminateThread() (which ideally must never be called on w32).

I need some guidance, I can implement it. I remember Samba implements
an interruptible select() using a wait on multiple object (equivalent)
by waiting on the actual socket/pipe and another pipe. Any signal
handler writes a byte into the other pipe. The wait on multiple object
returns and since we know which fd had data, we know it was due to an
interrupt/signal. A similar implementation could be used to implement
a cancel able IO, select().

-dky

-- 
Dhruva Krishnamurthy
Contents reflect my personal views only!




reply via email to

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