Re: Palatable Windows IO using Ada



On Mon, 10 Apr 2006 06:50:53 -0700, Steve wrote:

"Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote in message
news:o2i2brhcp49x$.1lmgnwrqgqzf7$.dlg@xxxxxxxxxxxxx

How would you tell that to the driver? Do you mean a true driver here or
merely a program that uses an OS serial driver? I meant the later...

So did I. On the systems I have used there have been systems calls "read
until character or timeout" or at least a mechnism of implementing that
functionality.

Then it should be "until delimiter or timeout or buffer is full." This is a
too specific, IMO. For some devices you would need a pattern matching
rather than simple delimiter. I don't think that it is worth to have
something like that in OS. If protected objects were supported, one could
just give a protected ring buffer to the driver.

I prefer two threads as well. It is my understanding that the only way to
do this on NT is using overlapped I/O. I have this working in my high level
interface to NT's serial port.

We used both overlapped and synchronous I/O over Windows serial port, with
no noticeable difference. In almost all cases the communication was without
either hardware handshake or parity, which should be a quite hard test, if
OS wouldn't buffer. In my experience, a correct use of SetCommTimeouts is
more delicate issue.

The clumsy interface has no relation to the choice of language of the
API.
And it shouldn't. It is based on the design of the driver. In the good
(or
bad?) old days, the OS interfaces used to be described in a language
neutral
manner... as it should be.

How can you do it language neutral? The problem is that asynchronous I/O
inherently requires concurrency. If the language does not support
concurrency, you simply cannot comprehensively describe what's going on.

Sure you can. You just have to be explicit about how concurrency is
handled, and can't take anything for granted.

But you just cannot be explicit. You have to document, to comment etc,
rather than to code. It is like types, you don't need typed languages. Just
carefully document each memory cell. The only problem is the abstraction
level.

[...]
Ada covers enough bases I only have to learn a small part of working with
the OS. This comes back to my claim that you can develop a system in almost
any programming language, given enough time and money... but if you want to
minimize either, use Ada.

Actually there is a physical limit of complexity at which the amount of
money becomes infinite. Though, long before that it will be bigger than the
national product. With time it is even worse. I wouldn't even try to
understand the Assembler code I wrote 20 years ago... (:-))

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



Relevant Pages

  • [PATCH 19-rc1] Fix typos in /Documentation : U-Z
    ... when the underlying device was capable of handling the i/o in one shot. ... using dev->irq by the device driver to request for interrupt service ... The EMU10K2 chips have a DSP part which can be programmed to support ... -(This acticle does not deal with the overall functionality of the ...
    (Linux-Kernel)
  • Re: [PATCH 19-rc1] Fix typos in /Documentation : U-Z
    ... +iii.Ability to represent large i/os w/o unnecessarily breaking them up (i.e ... when the underlying device was capable of handling the i/o in one shot. ... using dev->irq by the device driver to request for interrupt service ... -(This acticle does not deal with the overall functionality of the ...
    (Linux-Kernel)
  • [PATCH 18-rc3] Fix typos in /Documentation : S
    ... Request flows seen by I/O schedulers ... cpufreq-stats is a driver that provices CPU frequency statistics for each CPU. ... +interface will appear in a separate directory under cpufreq ... This drives supports all SMC ISA/MCA adapters. ...
    (Linux-Kernel)
  • Re: 3GL vs. 4GL [was: Re: LSP and subtype]
    ... But that doesn't mean the language designers shouldn't try to ... 3GL like C++, Java, C# augmented with appropriate libraries? ... Concurrency is an example of ... Java execution model is a pure synchronous model. ...
    (comp.object)
  • Re: What doesnt lend itself to OO?
    ... I would argue that qualifies as 3.nGL. ... > abstractions for concurrency, IMO that would bring n closer to being ... processes (it was the language for Inmos' transputers in the 80s or 90s, ... Java was the first one to incorporate ...
    (comp.object)