TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Wim Veldhuis
from: Mark Kimes
date: 1995-03-03 01:39:00
subject: Re: DosRead - Framing?

> WV> Also, when you do not have a 16550 with a FIFO, you probably
 > WV> be better of letting the read task just put the stuff into a
 > WV> buffer which is read by another thread. 

 > GB> Oops! DOS-ism detected! You *shouldn't* take into account
 > GB> which hardware you're using. OS/2 does the buffering, and
 > GB> has a big enough buffer to prevent the UART from overflowing

 WV>It is my experiantation that it does matter, before I had an 16550 I
 WV>would get transmission errors when switching tasks.

The 16550 matters, but whether you read inline or in a separate thread
doesn't.  The com driver is taking care of actually reading the port,
not your app.  It'll buffer 'em until you need 'em.  If you're in a
situation where you can't keep up with the com driver, a separate thread
is again not likely to be of much help, as you'll eventually not be able
to keep up with its secondary buffering -- there'd be a basic design
flaw in your program.

I suppose there are cases where a secondary thread would be beneficial,
but just to do again what the com driver is already doing (read and put
into a buffer to be pulled out by another thread) isn't really a reason
as such.  Someone else (Jon Guthrie) indicated that he got timing
control he needed using a secondary buffer.  I'm not sure how that is,
but you might talk to him about it.

For what I have experience with -- generic BBS stuff -- secondary com
threads are generally a waste of CPU.  However, I can envision situations
where it might be handy.  For instance, a protocol that took interweaved
packetized information and passed it to different threads for different
purposes.

--- XHEd-OS/2 1.22
* Origin: The Pit (1:380/16)
SEEN-BY: 105/42 620/243 624/50 711/401 409 410 413 430 807 808 809 934 955
SEEN-BY: 712/407 515 628 704 713/888 800/1 7877/2809
@PATH: 380/25 396/1 3615/50 105/103 42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.