[issue10444] A mechanism is needed to override waiting for Python threads to finish

2016-12-01 Thread Emanuel Barry

Emanuel Barry added the comment:

Let's just close this.

--
nosy: +ebarry
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2016-12-01 Thread Michael Hughes

Michael Hughes added the comment:

Given that this is from five years ago, and I've moved on, I honestly can't say 
I care too deeply about this.

My use case was for handling threads:
* created by inexperienced python programmers that don't know about daemons
* using third party python scripts that it would be easier not to edit

I feel that my proposed change handles that in a reasonable way, and doesn't 
complicate the interface for threads terribly. Most users can completely ignore 
the new method I proposed, and it won't affect them. For those going to look 
for it, it'll be there.

But again, I'm not even working in Python and no one else has chimed in on this 
in five years. Does it matter anymore?

- Michael

> On Nov 30, 2016, at 1:58 PM, Julien Palard  wrote:
> 
> 
> Julien Palard added the comment:
> 
> If nobody has nothing to add on this issue, I think it just should be closed.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2016-11-30 Thread Julien Palard

Julien Palard added the comment:

If nobody has nothing to add on this issue, I think it just should be closed.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2016-11-13 Thread Julien

Julien added the comment:

`daemon` flag cannot be changed after thread is started, the documentation is 
right and the code of the daemon setter is actually:

if self._started.is_set():
raise RuntimeError("cannot set daemon status of active thread")

But still it looks like a code review problem: all your daemonic threads should 
be created as daemonic.

Breaking the `daemon` semantics looks like a bug magnet: any future uses of 
non-daemonic threads (by an "experienced" developer of your team, specifically 
needing a non-daemon thread for a specific task) will behave as a deamon thread 
and the specific task may not be correctly executed (like, logging an 
exception?).

--
nosy: +sizeof

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2011-10-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Antoine wrote:
 You could instead enumerate() all threads and set their daemon flag
 to False, before shutting down the interpreter.

If it is intended to work this way, it should be mentioned in the documentation.

Currently the documentation for Thread.daemon says:
“This must be set before start() is called, otherwise RuntimeError is raised.”

--
nosy: +flox

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2011-03-19 Thread Skip Montanaro

Changes by Skip Montanaro s...@pobox.com:


--
nosy:  -skip.montanaro

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2011-03-19 Thread Michael Hughes

Michael Hughes michaelahug...@gmail.com added the comment:

Hey guys
We don't always have control over all of the threads launched within our 
application. We might have inexperienced users writing basic scripts using 
threads, but they don't know enough about setting them to Daemon. Previous 
versions of the Python interpreter we were using in our app didn't block.
I'd like an option to override the blocking, because for our application, for 
the most part, we do want it to always quit and not wait for threads to quit 
properly.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2011-03-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

This looks like an ugly hack to solve a slightly exotic problem. You could 
instead enumerate() all threads and set their daemon flag to False, before 
shutting down the interpreter.

--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-18 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo
versions:  -Python 2.6, Python 2.7, Python 3.1, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes

New submission from Michael Hughes michaelahug...@gmail.com:

We use the Python interpreter embedded in our application, and would prefer to 
not block an exit of our application waiting for non-daemon threads to finish.

I would like a mechanism exposed that queries for whether or not to wait.

--
components: Library (Lib)
messages: 121354
nosy: michaelahughes
priority: normal
severity: normal
status: open
title: A mechanism is needed to override waiting for Python threads to finish
type: feature request
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes

Michael Hughes michaelahug...@gmail.com added the comment:

I have a patch here.
It is to allow for a callback to be set on the main thread which gets called 
when there are non-daemon threads still alive on exit.
The callback returns True or False indicating whether or not it wants to block. 
By default, the whole thing blocks.

--
keywords: +patch
Added file: http://bugs.python.org/file19625/threadingchange.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes

Changes by Michael Hughes michaelahug...@gmail.com:


Removed file: http://bugs.python.org/file19625/threadingchange.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes

Michael Hughes michaelahug...@gmail.com added the comment:

Scratch that last patch. It was missing part of the fix.
I've removed the old patch now, and submitted the proper one.

--
Added file: http://bugs.python.org/file19626/real.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

How do you use it?

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Michael Hughes

Michael Hughes michaelahug...@gmail.com added the comment:

To use the callback, you can do this:

import threading

def threadendcallback():
  # return False to indicate that we don't
  # want to wait for any threads before exiting
  return False

threading.currentThread().waitForThreadsOnExitFunc = threadendcallback

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10444] A mechanism is needed to override waiting for Python threads to finish

2010-11-17 Thread Skip Montanaro

Skip Montanaro s...@pobox.com added the comment:

Why is setting your threads as daemons not an option?

--
nosy: +skip.montanaro

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10444
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com