Richard Oudkerk added the comment:

> As close() on regular files, I would prefer to call explicitly cancel() 
> to control exactly when the overlapped operation is cancelled.

If you use daemon threads then you have no guarantee that the thread will ever 
get a chance to explicitly call cancel().

> Can't you fix multiprocessing and/or the unit test to ensure that all 
> overlapped operations are completed or cancelled?

On Vista and later, yes, this is done in the deallocator using CancelIoEx(), 
although there is still a warning.  On XP it is not possible because CancelIo() 
has to be called from the same thread which started the operation.

I think these warnings come from daemon threads used by "manager" processes.  
When the manager process exits some background threads may be blocked doing an 
overlapped read.

(It might be possible to wake up blocked threads by setting the event handle 
returned by _PyOS_SigintEvent().  That might allow the use of non-daemon 
threads.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19565>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to