Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: PATCH: ptyread eating CPU on Cygwin



> This also changes comptest and nslookup to use `zpty -b' to get
> blocking IO on the pty. Hm, should blocking be the default and -b
> select non-blocking behaviour?
>

Yes, I'd say. I've tried to find reasonable usage for non-blocking mode and
failed. Consider "zpty -r foo bar pat" in non-blocking mode. It reads whatever
was available and returns error code if it did not match. So, what can program
now do with 'bar' content? Request additional read? That returns us to the
same busy loop problem. Or just through away. (This was discussed when zpty
was born).

So I suggest adding "read-with-timeout" possibilty, and making blocking read
default. It is also useful to distinguish between EOF and timeout with
different return code.

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author