home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / os2 / programm / 7529 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  2.5 KB

  1. Path: 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
  2. From: john.navas@uttsbbs.uucp (John Navas) 
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: RE: SURRENDERING TIMESLIC
  5. Message-ID: <3654.18.uupcb@uttsbbs.uucp>
  6. Date: 12 Jan 93 09:05:00 GMT
  7. Distribution: world
  8. Organization: The Transfer Station BBS, Danville, CA - 510-837-4610/837-5591
  9. Reply-To: john.navas@uttsbbs.uucp (John Navas) 
  10. Lines: 44
  11.  
  12. amitp@ruf.rice.edu (Amit J Patel) writes:
  13.  
  14.  >>> Once you know you're in an OS/2 DOS box, calling interrupt 2F
  15.  >>> with AX set 01680h will release the timeslice.
  16.  
  17.  >> Well, I tried this, and the program became REALLY slow.  The
  18.  >> interrupt seemed to be giving up almost a half-a-second, far more
  19.  >> than I wanted.  Why might this be?  I had in mind more like
  20.  >> 1/100th of a second, so my program would respond realtime.
  21.  
  22.  > I tried the timeslice code, too, and my program became unusably
  23.  > slow.  I also tried giving up the timeslice every n keyboard polls,
  24.  > but that didn't help (after I thought about it, it made sense that
  25.  > it wasn't better).
  26.  
  27. The reason is that the yield timeslice interrupt does *more* than
  28. simply releasing the timeslice -- although undocumented, it drops the
  29. priority of your VDM, in effect putting it to sleep for a while until
  30. something like a keypress interrupt is reflected into it.  This is
  31. either good news or bad news depending on what you are trying to do.
  32. (I submitted an APAR and this may eventually be changed.)  BTW, there
  33. is similar but slightly different undocumented behavior for this
  34. interrupt under Window 3.x.
  35.  
  36.  > Are there any other time-slice methods in use?  Perhaps by doing
  37.  > the DOS idle interrupt (28h?)?
  38.  
  39. There is no other way that I know of (other than relying on OS/2's
  40. idle detection).  For an app I was working on I was forced to write a
  41. VDD (virtual device driver) to implement a private yield timeslice
  42. (and nothing else) interrupt.
  43.  
  44. Best regards,
  45. John
  46.  
  47. p.s.  You significantly decrease overhead in an OS/2 VDM (virtual DOS
  48. machine) if you simulate an interrupt with a FAR CALL to an interrupt
  49. vector rather than issuing an actual interrupt.
  50.                                                                                    
  51. ----
  52. +------------------------------------------------------------------------+
  53. | The Transfer Station BBS (510) 837-4610 & 837-5591 (V.32bis both lines)|
  54. | Danville, California, USA. 400+ MB Files & FREE public Internet Access |
  55. +------------------------------------------------------------------------+
  56.