From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9bdd666589befb0f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed.gamma.ru!Gamma.RU!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Palatable Windows IO using Ada Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1144369304.698267.277640@u72g2000cwu.googlegroups.com> <15qxrbngb2kll.wkigwit0g1tn.dlg@40tude.net> <14sfx2j059hst$.1x6sfev1savpw.dlg@40tude.net> <07CdnZVlmZzv_6fZnZ2dnUVZ_t2dnZ2d@comcast.com> Date: Mon, 10 Apr 2006 17:05:33 +0200 Message-ID: <1wylcgrj8sco8$.6sr5gdt09h6a$.dlg@40tude.net> NNTP-Posting-Date: 10 Apr 2006 17:05:33 MEST NNTP-Posting-Host: 3a9ea7bb.newsread2.arcor-online.net X-Trace: DXC=6?MB7:eJc_F5VQnf?UOZgEQ5U85hF6f;DjW\KbG]kaMHAV6U:Z=fE=ORDa[O\3YO X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:3767 Date: 2006-04-10T17:05:33+02:00 List-Id: On Mon, 10 Apr 2006 06:50:53 -0700, Steve wrote: > "Dmitry A. Kazakov" wrote in message > news:o2i2brhcp49x$.1lmgnwrqgqzf7$.dlg@40tude.net... >> 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