TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Lee Aroner
from: David Noon
date: 1996-10-14 22:16:12
subject: DOS OS/2 Advice ??

On Saturday, 96/10/12, LEE ARONER wrote to JONATHAN DE BOYNE POLLARD
about "DOS OS/2 Advice ??" as follows:

LA>    I don't see it that way....what I want to do is relinquish the 
LA>    remainder of a slice, when I don't need *all* of it.....that's 
LA>    different from saying you have *no* usefull work to do...DV could 
LA>    do this, why not OS/2 ?

Hi Lee,

If your thread has useful work to do then why relinquish the
timeslice? We have preemptive thread management and if a higher
priority thread becomes ready, yours will be preempted at the end of
its current timeslice. Simply adjust your thread's priority so that it
doesn't steal CPU cycles from more important work.

Alternatively, if your thread has run out of work to do but is
expecting more then it should block on an event semaphore. When the
new work arrives the submitting thread should post the event and your
thread will resume. In the interim it will consume no CPU cycles at all,
regardless of its priority.

Simply releasing timeslices smacks of polling. However, if you want to
do it you simply use the DosSleep() API for a time less than 1
timeslice, which is typically 32 milliseconds under OS/2. However,
this seems like a bad way to design an app for OS/2. Don't poll; use
threads.

Regards

Dave
                                                          
                                                         

 * KWQ/2 1.2i * Read the docs. Wow, what a radical concept!
--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 440/4 141/209 270/101 712/515 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™.