[Tutor] Starbucks does not use two-phase commit
3dbernard at gmail.com
Mon Jan 23 20:55:37 CET 2006
Yes that makes sense, but...... what is a "daemon"?
Sorry if this is super basic question.
On 1/23/06, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
> > I noticed that when I do a keyboard interrupt, I get the keyboard
> > interrupt exception messages, but after that it keeps hangning and never
> > returns to the command line input mode. I have to close the shell to
> > really end the program afaics.
> Hi Bernard,
> When we're using the high-level 'threading' interface, the server thread
> --- which runs independently of the main thread --- will continue to run
> until it's shut down. But we can call setDaemon() on the server's thread
> to allow Python to exit. Look at the bottom of:
> So we can modify server.startServer() to flag the server thread as a
> def startServer(self):
> t = Thread(thread=self._jobLoop)
> > While I have been using the thread module, using:
> > thread.start_new( <function name>, ( <thread id>, <other args> ) )
> > When I implemented your example in my program, I also used your
> > approach, and started having the hanging behavior. I reconverted the
> > thread spawn to my own approch, just to see if it would make a
> > difference.
> The low level 'thread' library is a bit more platform specific. Here's
> what the documentation says:
> """When the main thread exits, it is system defined whether the other
> threads survive. On SGI IRIX using the native thread implementation,
> they survive. On most other systems, they are killed without
> executing try ... finally clauses or executing object destructors."""
> Does this make sense?
More information about the Tutor