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

  1. Path: sparky!uunet!psinntp!dg-rtp!salzo!dburton
  2. From: dburton@salzo.Cary.NC.US (David Burton)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Surrendering timeslice under DOS?
  5. Message-ID: <8oqZwB4w165w@salzo.Cary.NC.US>
  6. Date: Thu, 07 Jan 93 00:06:18 EST
  7. References: <1993Jan5.231303.14795@wicat.com>
  8. Organization: SalzoBoard BBS
  9. Lines: 29
  10.  
  11. kevin@wicat.com (Kevin Vigor) writes:
  12.  
  13. > Once you know you're in an OS/2 DOS box, calling interrupt 2F with AX set to
  14. > 01680h will release the timeslice.
  15.  
  16. Here's what I do:
  17.  
  18. /* do DOS multiplex interrupt to let other programs run */
  19. void tick(void)
  20.   {
  21.    union REGS regs;
  22.    long far * ptrkludge;
  23.     memset( ®s, 0, sizeof(union REGS) );
  24.     (void)int86( 0x28, ®s, ®s );  /* the old DOS idle handler */
  25.     ptrkludge = MK_FP( 0, 4*0x2F );  /* address of the int 2Fh vector */
  26.     if ((_osmajor >= 3) && *ptrkludge)
  27.       { /* if DOS 3 or later, and the 2Fh (multiplex) vector is non-zero 
  28. */
  29.         memset( ®s, 0, sizeof(union REGS) );
  30.         regs.x.ax = 0x1680;
  31.         (void)int86( 0x2F, ®s, ®s );  /* the new DOS idle call */
  32.       }/*if*/
  33.   } /* tick */
  34.  
  35. I hope this helps.
  36.  
  37. -Dave Burton, Burton Systems Software
  38. Tel: 919-233-8128  Fax: 919-233-0716
  39. dburton@salzo.cary.nc.us    Bix: dburton
  40.