Link to home
Start Free TrialLog in
Avatar of jsf
jsf

asked on

Release time-slice (Win95 DOS session)

 I need to run several DOS sessions on Windows 95 with programs that usually want to run for just 100 microseconds or so before releasing a time-slice.

  I have tried using int 2F AX=1680 to release time-slices and had unacceptable results.  Is there a better way to release time-slices or a system or session parameter that fixes the way 2F1680 works?

  The main problem is that sessions which don't have the keyboard focus usually go away for at least a second on a single 2F1680 request.  I need them to only go away for long enough to give every other session one time-slice.  I have had partial success by doing a write to the screen for every 2F1680.  This is imperfect for sessions that are visible but don't have the focus.  More seriously, it is useless for sessions that are minimized.  I want all sessions to get a turn every time around, regardless of whether they are minimized.
Avatar of faster
faster

You should use windows console program instead of DOS program, they are very similiar except that the former can use win32 APIs therefore it can simply call Sleep().
If your an experienced programmer, I would write a VXD, virtualize a port (say...0x600)..then I would do an I/O
in your prog to that port..in the port, I would store the
VMHANDLE of the calling io access to 600h...then I would issue a globaltimeout of however-many-milliseconds... which...after the elapsed time..does whatever.. (restore focus, whatever)... This way you don't need to be a win32 console app...

If your an experienced programmer, I would write a VXD, virtualize a port (say...0x600)..then I would do an I/O
in your prog to that port..in the port, I would store the
VMHANDLE of the calling io access to 600h...then I would issue a globaltimeout of however-many-milliseconds... which...after the elapsed time..does whatever.. (restore focus, whatever)... This way you don't need to be a win32 console app...

Avatar of jsf

ASKER

 It is a large complicated program with a mixture of C and assembler.  It has read/write variables in the code segment, segment arithetic, direct access to serial port hardware and other features that would be hard to port from a v86 environment to a Windows console program.  The release time-slice operation is in one routine and easy to change (if I knew what to change it to).  Changing the whole program is too hard for now.

   I am an experienced programmer, but not an experienced Windows programmer.  If I knew how to write a VXD, I would move key parts of this application (including release time-slice) into a VXD.  Right now, I don't think I have time to learn how to write a VXD.
segment-arithmetic?  meaning you're doing this in 16-bit?


You're stuck.  You might be able to change the variables in the .pif of the shortcut so that the programs in the foreground don't get a higher priority.

I think amartin's approach is the best.  VxD's format is exactly what you need.
ASKER CERTIFIED SOLUTION
Avatar of amartin030297
amartin030297

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial