Add a mini-rant to the top comment explaining why threads are
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 3 Sep 2006 12:55:16 +0000 (12:55 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 3 Sep 2006 12:55:16 +0000 (12:55 +0000)
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

index 222e5b9..b5f0b85 100644 (file)
  * 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 <assert.h>