TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Darin McBride
from: Phil Crown
date: 1997-01-12 13:07:02
subject: DosRead blocking

-=> Quoting Darin McBride to Peter Fitzsimmons <=-



 DM> ==extract==

 DM> Let's look at this more carefully, to see why the thread reading

 DM> from a slower device needs to be at a higher priority than the one

 DM> that is CPU-bound and reading those buffers.  Since the thread reading

 DM> the tape [comm-port] goes to the device, it will block and the

 DM> CPU-bound thread reading the buffers will be dispatched.  Since it is

 DM> CPU-bound, it will run to the end of its time slice unless it is

 DM> preempted by another thread.  If left at the same priorities, the

 DM> CPU-bound thread will starve the I/O-bound thread.  By bumping the

 DM> I/O-bound thread's priority slightly higher than the CPU-bound

 DM> thread's (not necessarily higher than every thread in the system), you

 DM> ensure that the I/O thread is dispatched whenever it is ready to run.

 DM> ==from David E Reich's "Designing High-Powered OS/2 Warp Applications:

 DM> The Anatomy of Multithreaded Programs"== 

 DM> If you have a large buffer filled by DosRead, by the time the

 DM> CPU-bound processing of the buffer is finished, the serial driver's

 DM> buffer may have been overfilled, and you may lose data.  By promoting

 DM> the DosRead()'s priority to slightly higher (and it can't be
"Regular"

 DM> since the CPU-bound one could be dynamically adjusted to higher than

 DM> the I/O bound one), you ensure that COM.SYS (or SIO.SYS)'s buffer

 DM> never overfills. 

 DM> I would rather a little extra CPU activity and no errors than less CPU

 DM> activity and errors...



This is very interesting.



Using SIO' PMLM I was seeing "(overrun)" errors with Warp v4, even at

PRTYC_TIMECRITICAL.  This is while getting continous stream of data,

such as listing all the files on my local BBS (about 3500+ on the hard

drive).



After someone suggested I add /!sms (BASEDEV=IBM1S506.ADD /A:0 /U:0

/!SMS) the overruns disappeared.



I'll have to do some testing to see if I get overruns at PRTYC_REGULAR.



Phil Crown

pcrown{at}airmail.net

http://web2.airmail.net/pcrown/



--- Blue Wave/OS2 v2.30

* Origin: * MacSavvy OS/2 BBS * Dallas, Texas * 972-250-4479 * (1:124/1208)
SEEN-BY: 50/99 54/99 270/101 620/243 625/0 160 711/401 409 410 413 430 808
SEEN-BY: 711/809 934 955 712/311 407 505 506 517 623 624 704 713/317 800/1
@PATH: 124/1208 1 396/1 270/101 712/624 711/808 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™.