Richard Oudkerk added the comment: On 13/11/2013 3:07pm, STINNER Victor wrote: >> On Vista and later, yes, this is done in the deallocator using >> CancelIoEx(), although there is still a warning. > > I don't understand. The warning is emitted because an operating is not done > nor cancelled. Why not cancel explicitly active operations in > manager.shutdown()? It is not possible?
shutdown() will be run in a different thread to the ones which started the overlapped ops, so it cannot stop them using CancelIo(). And anyway, it would mean writing a separate implementation for Windows -- the current manager implementation contains no platform specific code. Originally overlapped IO was not used on Windows. But, to get rid of polling, Antoine opened the can of worms that is overlapped IO:-) >> ... 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. > > I don't know overlapped operations. There are not asynchronous? What do you > mean by "blocked doing an overlapped read"? They are asynchronous but the implementation uses a hidden thread pool. If a pool thread tries to read from/write to a buffer that has been deallocated, then we can get a crash. By "blocked doing an overlapped read" I mean that a daemon thread is waiting for a line like data = conn.recv() to complete. ---------- _______________________________________ 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