robert wrote:
> killing hard (SIGKILL etc ) is low level. it should be OS-specific, as
> Python should not make itself inconsistent
(and os._exit() is that at mid-low level ; better not to say; no
finalizations etc.)
-robert
--
http://mail.python.org/mailman/listinfo/python-list
gangesmaster wrote:
> that's not a question of design. i just want a child-thread to kill the
> process. in a platform agnostic way.
>
the clean kill is the 'KeyboardInterrupt'. your code finalizations are
at least done corretly. thats also raised on SIGINT by default.
so thread.interrupt_main
that's not a question of design. i just want a child-thread to kill the
process. in a platform agnostic way.
--
http://mail.python.org/mailman/listinfo/python-list
i can't make the main thread daemonic. the situation is this:
* the main thread starts a thread
* the new thread does sys.exit()
* the new thread dies, but the process remains
i can do os.kill(os.getpid()), or TerminateProcess(-1) but that's not
what i want
-tomer
--
http://mail.python.org/mail
gangesmaster wrote:
> calling sys.exit() from a thread does nothing... the thread dies, but
> the interpreter remains. i guess the interpreter just catches and
> ignore the SystemExit exception...
>
> does anybody know of a way to overcome this limitation?
>
call thread.interrupt_main()
on *
gangesmaster:
>(i forgot to say it didn't work)
It's the remaining threads that need to be daemon, when some thread
performs sys.exit. When no non-daemon thread remains, the application
terminates.
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
(i forgot to say it didn't work)
--
http://mail.python.org/mailman/listinfo/python-list
>>> import threading
>>> t=threading.Thread(target=sys.exit)
>>> t.setDaemon(True)
>>> t.start()
>>>
?
--
http://mail.python.org/mailman/listinfo/python-list
gangesmaster wrote:
> calling sys.exit() from a thread does nothing... the thread dies, but
> the interpreter remains. i guess the interpreter just catches and
> ignore the SystemExit exception...
>
> does anybody know of a way to overcome this limitation?
Use Thread.setDaemon(True) on your thre
calling sys.exit() from a thread does nothing... the thread dies, but
the interpreter remains. i guess the interpreter just catches and
ignore the SystemExit exception...
does anybody know of a way to overcome this limitation?
-tomer
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo