[serial i/o under win32] -- even when using a separate worker-thread, i've usually wound up using non-blocking modes (generally "overlapped i/o", rarely "i/o completion ports"). this is with sockets and pipes too. asking a thread to terminate when it's got a blocking call can be messy, and polling-with-timeouts can be inefficient (horribly so if on the primary thread). without studying the pd serial issue further, i don't have any specific recommendations, but bear in mind that OVERLAPPED (asynchronous) is needed to enable more than one operation to be performed with the same handle, like a simultaneous read and write. also the ReadFile() and WriteFile() functions need a _lpOverlapped_ parameter the points to a OVERLAPPED structure (this maintains buffer-position pointers that would otherwise be done by the system under the covers).
cheers, ______________________ | b o b f a l e s c h | www.zeggz.com/raf/