[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Infinite polling loop
From: |
Thomas Dickey |
Subject: |
Re: Infinite polling loop |
Date: |
Sat, 2 Jun 2018 20:42:22 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sat, Jun 02, 2018 at 11:10:38AM -0500, Bryan Christ wrote:
> Thomas, the observation was on another application... VWM (which uses
> libvterm). I also observed this problem does not happen with Eterm or
> xterm.
The spinning is in libviper, where it attempts to read keys.
During libviper's initialization, it calls
nodelay(SCREEN_WINDOW, TRUE);
which tells it to not wait if there's no data. It then switches over
to the other protothread.
Changing that to a very small timeout (1 millisecond) gets rid of the
problem:
wtimeout(SCREEN_WINDOW, 1);
You wouldn't notice the problem on the Linux console, because
viper_kmio_fetch checks for data from GPM (which doesn't return
immediately).
> On Sat, Jun 2, 2018, 9:00 AM Thomas Dickey <address@hidden> wrote:
>
> > On Fri, Jun 01, 2018 at 11:27:50PM -0500, Bryan Christ wrote:
> > > I recently encountered a bizarre problem with a polling loop on Xubuntu
> > > 18.04. When I run my application on a standard tty, it runs fine. When I
> > > run it in xfce4-terminal the screen is completely blank. When I strace
> > > the
> > > application, it's running in an vigorous polling loop. When I run the
> > > application on 16.04 there are no problems at all on a standard tty nor on
> > > xfce4-terminal. On Xubuntu 18.04 ncurses = 6.1 (20180127). I also get
> > > the
> > > exact same behavior when I try to run in rxvt.
> >
> > hmm - I compiled
> > https://github.com/TragicWarrior/libvterm
> >
> > using Ubuntu 18.04 and don't see a problem (xfce4-terminal 0.8.7.3).
> > The vshell program works, and top shows a low load factor.
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature