From: Tait <gnu...@t4...> - 2021-06-22 12:00:19
|
I don't know anything about this code, so feel free to tell me I'm misdirected but... In ConsoleGetch(), _get_osfhandle is used on stdin. MS cautions [1] this might not be valid, and ConsoleGetch() does not check h!=-2. GetStdHandle or CreateFile [2] might be a better choice? MsgWaitForMultipleObjects is described as a "very tricky" API [3]. Although nothing else seems to fall afoul of [4]'s recommendations, I don't know why WaitForSingleObject isn't used instead, or just plain ReadFile. MS notes fread locks out other threads [5]. Is the writer ever another thread? As an incidental note, pipes created from cmd like in bug 2412 appear to be anonymous pipes and those do not support asynchronous read/write. [6] I don't think this matters here, but I mention it in case anybody thought they were going to get clever. [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle?view=msvc-160 [2] https://docs.microsoft.com/en-us/windows/console/console-handles [3] https://docs.microsoft.com/en-us/archive/blogs/larryosterman/things-you-shouldnt-do-part-4-msgwaitformultipleobjects-is-a-very-tricky-api [4] https://devblogs.microsoft.com/oldnewthing/20050217-00/?p=36423 [5] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fread?view=msvc-160 [6] https://docs.microsoft.com/en-us/windows/win32/ipc/anonymous-pipe-operations (Dropped CCs because this isn't about the Python problem anymore.) Ethan A Merritt <me...@uw...> said (on 2021/06/19): > ... > My understanding is that this is a known problem when combining specifically > gnuplot version 5.4 and Windows version 10. > > Issue tracker here > https://sourceforge.net/p/gnuplot/bugs/2412/ |