Solved

Release time-slice (Win95 DOS session)

Posted on 1997-09-02
6
252 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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