Solved

Release time-slice (Win95 DOS session)

Posted on 1997-09-02
6
241 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

708 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

13 Experts available now in Live!

Get 1:1 Help Now