|
From: sfeam <sf...@us...> - 2018-10-15 06:36:12
|
> > I.e.
> >
> > - we select(stdin, ipc_back_fd)
> > - select() returns immediately because there's data available on stdin
> > - we DON'T read this data
> > - we sleep a bit
> > - we select() again
> > - Since we never read the data select() said was available the first
> > time, select() returns immediately again
> > - And we spin
> >
> > Surely this can't be the intended behavior?
>
> It is the intended behaviour.
> It may not be ideal but it works.
> If you can draw up another scheme using only select I'd be
> happy to revisit the code. Maybe the code in the qt
> terminal could be used as a guide.
>
> Ethan
Or maybe it is as simple as
FD_ZERO(&fds);
if (!paused_for_mouse)
FD_SET(fd, &fds);
FD_SET(ipc_back_fd, &fds);
select()
I'll look at it some more tomorrow
Ethan
|