From: Gerd Knorr <kraxel@suse.de>
To: Kip Macy <kip.macy@gmail.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
Ewan Mellor <ewan@xensource.com>
Subject: Re: "xm save" trouble -- deadlock?
Date: Thu, 03 Nov 2005 09:53:47 +0100 [thread overview]
Message-ID: <4369D01B.1090307@suse.de> (raw)
In-Reply-To: <b1fa29170511021028mf42696ao3b08a62bb12ac548@mail.gmail.com>
Kip Macy wrote:
> What exactly is the thread shutdown problem here? Why the timeout is
> needed in the first place?
>
>
> I didn't see an answer on this thread so I'll take a stab.
>
> If you do a select without a timeout and no activity occurs on the file
> descriptors the thread may have no way of exiting cleanly.
Hmm, it's still not clear to me how this is supposed to work. How it is
signaled to the threads that they should exit? What I see when stracing
the thread, then run "xend stop" in another tty, is that the thread is
simply killed off with SIGHUP, with no cleanup being done by the thread.
The select() system call will also return on signals (with errno=EINTR)
unless you explicitly set SA_RESTART when calling sigaction(2). So if
SIGHUP is used to signal the thread it should exit the timeout can go
away. Probably the whole select() can go away as well as the accept()
will return on signals as well, so just sitting in the accept syscall
should work just fine too.
At the moment I still don't see the point in using select() in the first
place when there is one thread per socket anyway ...
cheers,
Gerd
prev parent reply other threads:[~2005-11-03 8:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-01 16:43 "xm save" trouble -- deadlock? Gerd Knorr
2005-11-01 17:15 ` Gerd Knorr
2005-11-01 18:54 ` Ewan Mellor
2005-11-02 9:25 ` Gerd Knorr
2005-11-02 10:04 ` Ewan Mellor
2005-11-02 11:24 ` Gerd Knorr
2005-11-02 15:35 ` Gerd Knorr
2005-11-02 15:41 ` Ewan Mellor
2005-11-02 17:23 ` Gerd Knorr
2005-11-01 18:58 ` Ewan Mellor
2005-11-02 11:34 ` Gerd Knorr
2005-11-02 18:28 ` Kip Macy
2005-11-03 8:53 ` Gerd Knorr [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4369D01B.1090307@suse.de \
--to=kraxel@suse.de \
--cc=ewan@xensource.com \
--cc=kip.macy@gmail.com \
--cc=xen-devel@lists.xensource.com \
/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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.