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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d0077c2a3f44fc09 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 13 Dec 2004 20:41:11 -0600 From: "Steve" Newsgroups: comp.lang.ada References: <1gr5159dmj2vk.5tkxiw6kxrmv.dlg@40tude.net> <1olbt9ia2fuuo$.qbyglb1cl3g8.dlg@40tude.net> Subject: Re: Port LPT + ADA (whta do I wrong?) Date: Mon, 13 Dec 2004 18:41:12 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: <0KGdndvaSOZazyPcRVn-vg@comcast.com> NNTP-Posting-Host: 24.22.63.157 X-Trace: sv3-7pXm2CU5/3TIYgPepyjqI5F2+1+DFSDkKowWpyA/55rlyvuINi5fY+obxyr2fxTnCzZdCV1hw+QS26d!NxnrFDHWgAvKXzbd4Om7L+rmSqknnIWA4npWIcMAczVG0QH5VejB8uXL2OrG X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.20 Xref: g2news1.google.com comp.lang.ada:6930 Date: 2004-12-13T18:41:12-08:00 List-Id: I'll send you my serial driver sources via email. Steve (The Duck) "Brian May" wrote in message news:sa48y83qhm1.fsf@snoopy.apana.org.au... >>>>>> "Steve" == Steve writes: > > Steve> Unless you're speaking about something specific to handling > Steve> of the parallel port, I can say for certain that with > Steve> serial I/O you must use OVERLAPPED I/O if you want to do > Steve> full duplex communication. This is not obvious from the > Steve> documentation, but if you dig far enough (and try it) > Steve> you'll find that this is the case. > > Ok, this might be my problem I have encountered with serial I/O, where > I read from a serial port in one thread and write to it in another > thread... > > I found sample code that does this (Ada Terminal Emulator at > http://www.members.optusnet.com.au/rosshigson/terminal.htm), according > to the comment: > > -- 1. Windows NT is unable to read and write at the same > -- time. Attempts to do so result in one or the other > -- being blocked. Therefore, by default we use a mutex to > -- serialize read and write calls. Windows 95/98 can read > -- and write at the same time, so we can use the option > -- "/nomutex". > > This seems kind of dodgy to me, and presumably means if something is > to be written it cannot be written until the read call returns. > > Steve> Before using OVERLAPPED operations I found the little > Steve> ideosyncracy that if I had one thread waiting on a read, > Steve> another thread couldn't do a write until the read finished. > Steve> Using overlapped the write causes the read to wake up, the > Steve> write does it's thing. When my code detects that the read > Steve> hasn't finished, it goes back and reads again. A pain in > Steve> the butt, but it works. > > Does anyone have sample Ada code that uses OVERLAPPED operations? > -- > Brian May