Solved

Release time-slice (Win95 DOS session)

Posted on 1997-09-02
6
244 Views
Last Modified: 2013-12-03
 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.
0
Comment
Question by:jsf
6 Comments
 
LVL 7

Expert Comment

by:faster
ID: 1405524
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().
0
 
LVL 2

Expert Comment

by:amartin030297
ID: 1405525
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...

0
 
LVL 2

Expert Comment

by:amartin030297
ID: 1405526
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...

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:jsf
ID: 1405527
 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.
0
 
LVL 3

Expert Comment

by:vinniew
ID: 1405528
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.
0
 
LVL 2

Accepted Solution

by:
amartin030297 earned 100 total points
ID: 1405529
The 'answer' is that you CANNOT have a ring-3, 16bit DOS application 'yield' for 100ms with conventional methods like an INT. without writing a VxD.

The EASIEST thing to do it buy VToolsD (www.vireo.com) for $495.  It 'makes' a VxD for you.. then with the examples you can see how to virtualize a port, and issue the timeout just like I said earlier.

      -- Aaron

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now