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: Robin Haberkorn
Subject: Re: Is a "silent" ncurses initialization possible?
Date: Tue, 9 Jun 2015 13:13:40 +0200

On Tue, 9 Jun 2015 08:56:37 +0200
Stian Skjelstad <address@hidden> wrote:

> 
> 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.
> 

Yes, that might work, too. On Unix and ncurses... But it involves some
relatively costly operations: Whenever I need to call something
(Scintilla message) that might result in a ncurses call I'd have to do:
 * copy the parameters
 * signal the UI thread; or interrupt the UI thread's event loop
 * wait on a condition variable.

I think that cbreak() and handling SIGINT is both more efficient and
elegant on this platform. On other Curses platforms I can still only
poll for the relevant key presses. Using multiple threads has no
benefit on these platforms (e.g. PDCurses on Windows console).

Attachment: signature.asc
Description: PGP signature


reply via email to

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