🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

RE: SURRENDERING TIMESLIC

#3468
From: John Navas
Date: Tue, 12 Jan 1993 09:05
44 lines
2642 bytes
amitp@ruf.rice.edu (Amit J Patel) writes:

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

 >> Well, I tried this, and the program became REALLY slow.  The
 >> interrupt seemed to be giving up almost a half-a-second, far more
 >> than I wanted.  Why might this be?  I had in mind more like
 >> 1/100th of a second, so my program would respond realtime.

 > I tried the timeslice code, too, and my program became unusably
 > slow.  I also tried giving up the timeslice every n keyboard polls,
 > but that didn't help (after I thought about it, it made sense that
 > it wasn't better).

The reason is that the yield timeslice interrupt does *more* than
simply releasing the timeslice -- although undocumented, it drops the
priority of your VDM, in effect putting it to sleep for a while until
something like a keypress interrupt is reflected into it.  This is
either good news or bad news depending on what you are trying to do.
(I submitted an APAR and this may eventually be changed.)  BTW, there
is similar but slightly different undocumented behavior for this
interrupt under Window 3.x.

 > Are there any other time-slice methods in use?  Perhaps by doing
 > the DOS idle interrupt (28h?)?

There is no other way that I know of (other than relying on OS/2's
idle detection).  For an app I was working on I was forced to write a
VDD (virtual device driver) to implement a private yield timeslice
(and nothing else) interrupt.

Best regards,
John

p.s.  You significantly decrease overhead in an OS/2 VDM (virtual DOS
machine) if you simulate an interrupt with a FAR CALL to an interrupt
vector rather than issuing an actual interrupt.
                                                                                   
----
+------------------------------------------------------------------------+
| The Transfer Station BBS (510) 837-4610 & 837-5591 (V.32bis both lines)|
| Danville, California, USA. 400+ MB Files & FREE public Internet Access |
+------------------------------------------------------------------------+
Technical Details
Message-ID: <3654.18.uupcb@uttsbbs.uucp>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!netcomsv!boo!uttsbbs!john.navas

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!csus.edu!netcom.com!netcomsv!boo!uttsbbs!john.navas
From: john.navas@uttsbbs.uucp (John Navas) 
Newsgroups: comp.os.os2.programmer
Subject: RE: SURRENDERING TIMESLIC
Message-ID: <3654.18.uupcb@uttsbbs.uucp>
Date: 12 Jan 93 09:05:00 GMT
Distribution: world
Organization: The Transfer Station BBS, Danville, CA - 510-837-4610/837-5591
Reply-To: john.navas@uttsbbs.uucp (John Navas) 
Lines: 44