Typed characters are mis-ordered when CPU usage is high

Orgad Shaneh orgads@gmail.com
Thu Mar 10 13:17:03 GMT 2022


On Thu, Mar 3, 2022 at 2:02 AM Takashi Yano <takashi.yano@nifty.ne.jp> wrote:
>
> On Wed, 2 Mar 2022 22:13:30 +0200
> Orgad Shaneh wrote:
> > On Wed, Mar 2, 2022 at 1:13 AM Takashi Yano <takashi.yano@nifty.ne.jp> wrote:
> > >
> > > Hi Orgad,
> > >
> > > On Sun, 27 Feb 2022 23:53:03 +0900
> > > Takashi Yano wrote:
> > > > On Sun, 27 Feb 2022 16:39:24 +0200
> > > > Orgad Shaneh wrote:
> > > > > Hi,
> > > > >
> > > > > I'm using cygwin runtime 3.3.4-2.
> > > > >
> > > > > When a foreground job is running, and the general CPU usage of the
> > > > > machine is high, characters are mis-ordered.
> > > > >
> > > > > To reproduce, I use this script to produce load:
> > > > > #!/bin/sh
> > > > >
> > > > > for i in $(seq $(nproc)); do
> > > > >   while true; do :; done &
> > > > > done
> > > > > wait
> > > > >
> > > > > Run it in the background, then run a long foreground job, and while it
> > > > > is running, type something.
> > > > >
> > > > > Example:
> > > > > $ spin.sh &
> > > > > $ sleep 3 # While it is running, I quickly typed git status
> > > > > $ sigt tatus
> > > > >
> > > > > This reproduces on Windows Terminal and on cmd (Cygwin.bat)
> > > >
> > > > Thanks for the report.
> > > >
> > > > I think this is due to a bug which I recently fixed.
> > > > https://cygwin.com/pipermail/cygwin-patches/2022q1/011791.html
> > >
> > > Now, new developer snapshot is ready: https://cygwin.com/snapshots/
> > > Please try.
> >
> > Tested. Looks much better. Thanks!
>
> Thanks for testing. But what do you mean by 'better'?
> Do you mean that the problem still happens in lower probability?


After using it on more scenarios (3.3 branch), I see have strange problems.

For example, if I run git log -1 and immediately type, my input is
lost until the prompt appears again.

It doesn't happen with other commands like git status, I'm not sure
why there's a difference.

- Orgad


More information about the Cygwin mailing list