bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is a "silent" ncurses initialization possible?


From: Stian Skjelstad
Subject: Re: Is a "silent" ncurses initialization possible?
Date: Tue, 9 Jun 2015 08:56:37 +0200

But what's worse: Even then, I don't think it will work.
How can the "worker" (non-UI) thread get the UI thread that is blocking
on getch() to wake up and perform additional ncurses operations???
AFAIK and according to getch(3NCURSES) there is no way to interrupt
getch() via signals and no thread-safe function for inserting messages
into the input FIFO that could be abused for turning getch() into
an event loop. As long as the UI thread is blocking, it appears
there is no way to safely call other curses functions.

If main-loop uses select() or poll(), then there is no point in calling getch() until data is waiting on the input file descriptor (normally 0 / stdin )
 
And those calls can be interrupted, or you can use a pipe as signal, since that will trigger select/poll if polled on.


Stian Skjelstad

reply via email to

[Prev in Thread] Current Thread [Next in Thread]