Hi, On 8/18/07, Jason Rumney wrote: > dhruva wrote: > > It is the call to read in _sys_read_ahead which continues to block > > even after the sub process is killed. If we change that read to use > > ReadFile using OVERLAPPED structure, we could handle canceling of IO > > when we want to terminate the thread more elegantly. But, that would > > be more changes as we need to use the HANDLE and not fd. > > > > This would be a good change, not just here, but in sys_select in > w32proc.c, which is overcomplicated due to a past design decision to I have made a new patch using ASYNC Read in _sys_read_ahead. We now have an IO that can be canceled. With this, the call to TerminateThread in the delete_child in w32proc.c should ideally never happen. Once this gets well tested, I will try to implement similar ASYNC mechanisms in sys_select. In the patch, I have made a call to memset in the _sys_read_ahead. Since we read char at a time, this could be considered as an overhead. I did not want to Since I have XP, I request others to test the patch on different supported windows flavors of emacs. I have tested with the reproducer (calling perl), invoking a command shell and typing various dos commands. I have not noticed any failures so far. -dky -- Dhruva Krishnamurthy Contents reflect my personal views only!