comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: problems with interfacing c
Date: Fri, 21 Jan 2011 01:46:24 +0100
Date: 2011-01-21T01:46:24+01:00	[thread overview]
Message-ID: <op.vpmu3mdxule2fv@garhos> (raw)
In-Reply-To: 10wpqz6h1md5o.1gxwql45phwmt.dlg@40tude.net

Le Fri, 21 Jan 2011 00:03:22 +0100, Dmitry A. Kazakov  
<mailbox@dmitry-kazakov.de> a écrit:
>> Some body do, for some kind of raw IO. Just that this may be more  
>> oftenly
>> something like
>>     Character'Read (Standard_Input), C);
>
> That the point, when reading characters that suggests some character  
> stream
> oriented protocol. Dealing with such protocols one would never read 100K  
> in
> one chunk. Because if the client does something wrong that would deadlock
> forever.
This could block for a single character as much. The only way to not block  
would be either to test before read; this implies to read an item at a  
time, before the condition must be checked before each item is read (so a  
loop), or else indeed to use asynchronous IO as you suggested later. With  
the latter choice, buffered IO is OK. You may use Overlapped IO in  
Windows, alternatively, there are nonblocking socket IO available (returns  
WSAEWOULDBLOCK error if a read access would block). Don't know about POSIX  
(oops).

(I feel to remember there was a talk here about buffered IO, I cannot  
remember the thread's title)

-- 
Si les chats miaulent et font autant de vocalises bizarres, c’est pas pour  
les chiens.

“I am fluent in ASCII” [Warren 2010]



  reply	other threads:[~2011-01-21  0:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-20 20:21 problems with interfacing c Stoik
2011-01-20 20:56 ` Dmitry A. Kazakov
2011-01-20 21:31   ` Yannick Duchêne (Hibou57)
2011-01-20 23:03     ` Dmitry A. Kazakov
2011-01-21  0:46       ` Yannick Duchêne (Hibou57) [this message]
2011-01-21  9:33         ` Dmitry A. Kazakov
2011-01-28  0:39   ` Stoik
2011-01-28  5:24     ` Yannick Duchêne (Hibou57)
2011-01-28  9:41     ` Ludovic Brenta
2011-01-28  9:44     ` Dmitry A. Kazakov
2011-01-31 21:46       ` Stoik
2011-01-31 23:06         ` Edward Fish
2011-02-01  8:48         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox