[Top][All Lists]

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

Re: [GNUnet-developers] W32 console woes

From: LRN
Subject: Re: [GNUnet-developers] W32 console woes
Date: Wed, 08 Jan 2014 07:36:09 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Thunderbird/29.0a1

Hash: SHA1

On 07.01.2014 20:52, Christian Grothoff wrote:
> On 01/07/2014 05:40 PM, LRN wrote:
>> With gnunet-conversation we now have an application with
>> interactive console UI. Which requires selecting on a console. 
>> Skip to the last paragraph for the important part.
>> I have found no way to wait (and thus select) on a console
>> handle. Thus it will have to be done with a thread. That thread
>> could work the same way the socket-selecting thread works (except
>> that it will only wait for a single console, not for a set of 
>> them) - i.e. it will be woken when selecting is needed, then it
>> will block on a read, and will either unblock and wake up
>> everyone else, or keep blocking, in which case the main thread
>> will force it to unblock by simulating a console write; then the
>> waiter thread will go to sleep until the next select call.
>> OR it could be implemented as a constantly-working thread that
>> just always reads from console, puts read data into a buffer and
>> maintains an event object that is set as long as there are events
>> in the buffer, thus allowing the main thread to just wait on that
>> event.
> OR we could do our usual trick and fork another helper process to 
> interact with the console ;-).

That might work, as it turns console I/O into socket or pipe I/O (both
of which are supported), from the point of view of the application.
I'll dig a bit into this direction.

- -- 
O< ascii ribbon - stop html email! -
Version: GnuPG v1.4.11 (MingW32)


reply via email to

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