WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] "xm save" trouble -- deadlock?

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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel