From 8e32bfe0fe09a18bdab9e68332caaedb884628d3 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 3 Sep 2006 12:55:16 +0000 Subject: [PATCH] Add a mini-rant to the top comment explaining why threads are required. (I just tried getting rid of them; it worked fine for serial ports, but not for anything else. The Windows I/O API sucks.) git-svn-id: svn://svn.tartarus.org/sgt/putty@6843 cda61777-01e9-0310-a592-d414129be87e --- windows/winhandl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/windows/winhandl.c b/windows/winhandl.c index 222e5b93..b5f0b859 100644 --- a/windows/winhandl.c +++ b/windows/winhandl.c @@ -16,6 +16,17 @@ * write; so the output thread waits for an event object notifying * it to _attempt_ a write, and then it sets an event in return * when one completes. + * + * (It's terribly annoying having to spawn a subthread for each + * direction of each handle. Technically it isn't necessary for + * serial ports, since we could use overlapped I/O within the main + * thread and wait directly on the event objects in the OVERLAPPED + * structures. However, we can't use this trick for some types of + * file handle at all - for some reason Windows restricts use of + * OVERLAPPED to files which were opened with the overlapped flag - + * and so we must use threads for those. This being the case, it's + * simplest just to use threads for everything rather than trying + * to keep track of multiple completely separate mechanisms.) */ #include -- 2.11.0