comp.lang.ada
 help / color / mirror / Atom feed
From: "Steve" <nospam_steved94@comcast.net>
Subject: Re: Port LPT + ADA (whta do I wrong?)
Date: Mon, 13 Dec 2004 18:41:12 -0800
Date: 2004-12-13T18:41:12-08:00	[thread overview]
Message-ID: <0KGdndvaSOZazyPcRVn-vg@comcast.com> (raw)
In-Reply-To: sa48y83qhm1.fsf@snoopy.apana.org.au

I'll send you my serial driver sources via email.

Steve
(The Duck)

"Brian May" <bam@snoopy.apana.org.au> wrote in message 
news:sa48y83qhm1.fsf@snoopy.apana.org.au...
>>>>>> "Steve" == Steve  <nospam_steved94@comcast.net> 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 <bam@snoopy.apana.org.au> 





  reply	other threads:[~2004-12-14  2:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-03 13:56 Port LPT + ADA S�awo - MIR
2004-12-03 14:40 ` Martin Krischik
2004-12-03 15:29   ` Slawo - MIR
2004-12-03 18:46     ` Martin Krischik
2004-12-03 18:43 ` tmoran
     [not found] ` <u111r0db4fsoj9u3hlkachspjt0r2vvup7@4ax.com>
2004-12-03 23:03   ` Adrien Plisson
2004-12-03 23:51     ` Slawo - MIR
2004-12-04  0:51     ` Jeffrey Carter
2004-12-04 18:05 ` Port LPT + ADA (whta do I wrong?) S�awo - MIR
2004-12-04 20:20   ` Dmitry A. Kazakov
2004-12-07 18:13     ` Slawo - MIR
2004-12-07 20:55       ` Dmitry A. Kazakov
2004-12-08  4:28         ` Steve
2004-12-08  8:27           ` Dmitry A. Kazakov
2004-12-12 22:25           ` Brian May
2004-12-14  2:41             ` Steve [this message]
2004-12-12 22:46           ` Brian May
2004-12-12 23:03             ` Adrien Plisson
     [not found]       ` <rt8dr09tuvgbqaeq9vmujd1pqtb72hbamv@4ax.com>
2004-12-09  8:17         ` Jerry van Dijk
2004-12-05  6:45   ` Brian May
replies disabled

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