unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: dhruva <dhruvakm@gmail.com>
To: "Emacs Devel" <emacs-devel@gnu.org>
Subject: Re: [andrew.maguire@ge.com: Emacs 22.1 hung after delete-process]
Date: Thu, 16 Aug 2007 22:34:39 +0530	[thread overview]
Message-ID: <e3f230850708161004w616df145sdeda6df534502e14@mail.gmail.com> (raw)
In-Reply-To: <e3f230850708160709w673f9196t5262cc6bdb3cb22c@mail.gmail.com>

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	other threads:[~2007-08-16 17:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-15 18:21 [andrew.maguire@ge.com: Emacs 22.1 hung after delete-process] Richard Stallman
2007-08-16  3:24 ` Glenn Morris
2007-08-16  4:46   ` dhruva
2007-08-17  0:32     ` Richard Stallman
2007-08-16  8:02   ` Jason Rumney
2007-08-16 12:42     ` dhruva
2007-08-16 14:09       ` dhruva
2007-08-16 17:04         ` dhruva [this message]
2007-08-16 19:41         ` Eli Zaretskii
2007-08-17  0:32         ` Richard Stallman
2007-08-17  5:27           ` dhruva
2007-08-27 10:07           ` dhruva
2007-09-02 17:02             ` Jason Rumney
2007-08-17 13:43         ` Jason Rumney
2007-08-17 17:31           ` dhruva
2007-08-17 20:40             ` Jason Rumney
2007-08-19  7:42               ` dhruva
2007-08-22  6:29                 ` dhruva

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e3f230850708161004w616df145sdeda6df534502e14@mail.gmail.com \
    --to=dhruvakm@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).