[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 |
-----BEGIN PGP SIGNED MESSAGE-----
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! - www.asciiribbon.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
iQEcBAEBAgAGBQJSzMepAAoJEOs4Jb6SI2CwUYQH/iThvMUYccR+oK6m4fn/fduA
LjmABLkO894f+PSGNtfWWYxX8PnUCpeUwsC4Q3DfQZTy8hD5QtFO4tYy2DNltac7
McNy9nAj9kJV6dQmcDxTcl1mUIeYnwf060N8L51PTvHp+1luY9Y7qK2a64pDBL5i
DHEyRx3lsJH6rFdJXBAvLTvCTsdQiiyQKK7G24u3f9T3BY4OJviIpN7dRfn+LmTo
1p5x6WHJK4NxVt7XMkl/7TwIuo6MRgKhrnExh8XfAZV+vY1AwV2pMWscvRQnaFwE
yRmFt2Vc0xjRa0I6Zz8I0UjYCB4oa6b/FsOuUQwNBCE04nVqIVG9oKzknuGANNs=
=yyir
-----END PGP SIGNATURE-----