🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #3283

Re: Surrendering timeslice under DOS?

#3283
From: Kevin Vigor
Date: Tue, 05 Jan 1993 23:13
35 lines
1417 bytes
David James Alexander Hanley <U16244@uicvm.uic.edu> writes:

>(global) int under_os2 = test_under_os2();

>{
>..
>..
>  while ( !kbhit() && !mouse_pressed() )
>    if ( under_os2 ) surrender_timeslice();
>}

>  Okay, that's not the most efficent way, but you see that I mean.  It
>drives me nuts to have a dos program that needs 3% of the CPU consuming
>100% of it.


<who maintains the FAQ for this group? This should probably be included...>

Anyway, there is some debate as to how best to determine if you're running
in an OS/2 DOS box. Myself, I prefer to check the DOS version; if the major
version is 20 or above, you're under OS/2 2.x.

Once you know you're in an OS/2 DOS box, calling interrupt 2F with AX set to
01680h will release the timeslice.

I have no idea if it works in OS/2 versions previous to 2.0; I do know it
works under Windows 3.x.

dd

-- 
		Peace & PopTarts, 
			Kevin
Email to the reply address will almost certainly bounce; use
72500.3705@compuserve.com
Technical Details
Message-ID: <1993Jan5.231303.14795@wicat.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!gossip.pyramid.com!olivea!sgigate!sgiblab!spies!wicat!kevin
References: <93003.035144U16244@uicvm.uic.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!gossip.pyramid.com!olivea!sgigate!sgiblab!spies!wicat!kevin
From: kevin@wicat.com (Kevin Vigor)
Newsgroups: comp.os.os2.programmer
Subject: Re: Surrendering timeslice under DOS?
Message-ID: <1993Jan5.231303.14795@wicat.com>
Date: 5 Jan 93 23:13:03 GMT
References: <93003.035144U16244@uicvm.uic.edu>
Reply-To: kevin@elvis.wicat.com
Organization: WICAT Systems
Lines: 35