Eryk Sun added the comment:

> After enabling `QuickEdit Mode`, then click the console will 
> suspend the program.

That's not suspending the entire process. It's blocking the thread that writes 
to the console. The user-mode WriteConsole function is implemented by a 
synchronous NtDeviceIoControlFile system call. The console (i.e. conhost.exe) 
is on the other end of the call. It has at least 2 threads -- an input thread 
that's basically a standard message loop and an output thread for updating and 
rendering the contents of its active screen buffer. It's a feature that 
clicking on the console window to copy text causes its output thread to block. 
This in turn prevents WriteFile in python.exe from completing.

That said, I've seen random hangs in the console that are unrelated to the 
above (e.g. hanging while reflowing text), but not often enough that I bothered 
to investigate it. There's a lot of new code in the 2nd generation console 
implementation (ConhostV2.dll) in Windows 10, and the developers are making 
significant improvements with each update. I'm waiting for the dust to settle.

----------

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

Reply via email to