comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: open a file non-blocking ?
Date: Mon, 26 Feb 2018 17:55:53 +0100
Date: 2018-02-26T17:55:53+01:00	[thread overview]
Message-ID: <p71e6n$6l7$1@gioia.aioe.org> (raw)
In-Reply-To: p71db5$tqf$1@dont-email.me

On 2018-02-26 17:41, Jeffrey R. Carter wrote:
>> On Saturday, February 24, 2018 at 2:42:30 PM UTC-5, 
>> pat...@spellingbeewinnars.org wrote:
>> There does not seem to be an option to open a file non-blocking. Is 
>> there a way?
> 
> I guess it depends on what you mean by non-blocking. Some of the 
> responses on here seem to think it means you can issue a write to the 
> file and it returns immediately, without waiting for the write to file 
> to complete.
> 
> If that's the case, the normal way to deal with this within Ada is 
> something like

[...]

No, to my understanding the question was about using OS asynchronous I/O 
facilities rather than mimicking them on top of Ada blocking tasks. 
Apart from wasting resources it is not even close to be asynchronous in 
the sense of I/O. The monitor solution you described does not actually 
multiplex I/O requests. It does single *blocking* request at a time.

As an example consider dealing with several sockets. With a socket 
selector all socket I/O is done concurrently. This is true asynchronous 
I/O. With a monitor task, only one socket can be serviced at a time. The 
difference in terms of data throughout and packet latencies will be 
gigantic.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2018-02-26 16:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-24 19:42 open a file non-blocking ? patrick
2018-02-25  7:57 ` Dmitry A. Kazakov
2018-02-25 12:38   ` patrick
2018-02-26  2:53 ` Robert Eachus
2018-02-26  9:33   ` Dmitry A. Kazakov
2018-02-26 16:41   ` Jeffrey R. Carter
2018-02-26 16:55     ` Dmitry A. Kazakov [this message]
2018-02-27 17:14       ` patrick
2018-02-27 17:32         ` Dmitry A. Kazakov
2018-02-27 23:33           ` patrick
2018-02-28  1:13         ` Dennis Lee Bieber
replies disabled

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