Re: Non-blocking activateCDKEntry or an alternative
From:
Thomas Dickey
Subject:
Re: Non-blocking activateCDKEntry or an alternative
Date:
Sun, 01 Jul 2012 12:06:48 -0400
User-agent:
Mutt/1.5.18 (2008-05-17)
On Fri, Jun 29, 2012 at 02:32:39PM +0300, Marius Gavrilescu wrote:
> Say I have a program which reads input from the user with a CDKENTRY
> but which also wants to read commands from a socket.
> Those commands update other CDK widgets
>
> Unfortunately, activateCDKEntry(input, NULL) blocks until
> the user enters RET TAB or ESC. Therefore if I let the user write
> commands, I cannot read commands from the server
>
> 1. Is there anything similar to select/poll/epoll which lets me
> wait for a CDKENTRY and for a file descriptor simultaneously?
>
> 2. If not, can I somehow tell activateCDKEntry to time out and
> return NULL after some time?
>
> 3. If not, can I update and redraw a widget from a SIGIO handler
> which interrupts activateCDKEntry?
>
> 4. If not, can I update and redraw a widget from a thread while
> activateCDKEntry is running in another thread?
>
> 5. If not, can I make activateCDKEntry return NULL in the main thread
> by running something in another thread?
>
> 6. If not, is there any other way to simultaneously wait
> for input from a CDKENTRY and from a file descriptor?
hmm - that's 6 ways of stating the same issue: CDK doesn't use polled
or nonblocking I/O, and doesn't have a way to work with multithreaded
code. The closest to that is the use of tabs in the traverse functions -
which only provide a way to switch focus between different CDK widgets.
--
Thomas E. Dickey <address@hidden>
http://invisible-island.netftp://invisible-island.net