Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Release time-slice (Win95 DOS session)

Posted on 1997-09-02
6
Medium Priority
?
268 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

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 200 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and 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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

688 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