Subscribe to Windows IT Pro
August 10, 1999 09:41 AM

Performance Tuning for DOS Applications

Windows IT Pro
InstantDoc ID #7067
Rating: (0)

The alert reader will have noticed that editing the BadApp settings in the Registry works on only Win16 or Win32 applications. What about DOS applications?

Standard DOS applications work in a single-user, single-tasking environment and use nearly 100 percent of CPU time because they constantly poll for keyboard strokes. If you're not sure this usage is a problem for your DOS applications, run the Performance Monitor and watch CPU activity on a terminal server running a DOS application. Even when the application isn't accepting input, it's CPU-hungry as long as it's in the foreground.

If you have a DOS application, you can reduce its CPU appetite by either of two methods. You can edit the application's properties to make it more sensitive to idle time, or you can use the DOSKBD utility to make Windows NT Server 4.0, Terminal Server Edition monitor how much CPU time the application is using and cut it off when it gets too greedy.

To edit the application's properties, move to its application directory and find the executable file. Right-click the executable's icon, and choose Properties from the pop-up list. You'll see the application's Properties sheet. Then, move to the Misc tab.

The idle sensitivity setting you see tells the system how much CPU time to let the application use when not accepting input or performing calculations. The lower the sensitivity, the more CPU cycles the application gets, the more responsive it is, and the more it affects the performance of other applications. Increase the sensitivity, exit the Properties sheet, and Terminal Server will create a shortcut containing the changes to the application.

To take advantage of the change you made, you must run the shortcut. Running the unmodified application or running the application from the command line will use the default command prompt properties, not those of the application. Because every application is different, you'll have to experiment to see how much you can raise the idle sensitivity before the application becomes dysfunctional.

The sensitivity setting applies to only idle time. If you want to reduce the CPU cycles an application gets all the time, you'll need DOSKBD. This utility works by monitoring the frequency with which the DOS application checks the keyboard buffer for input. If the application checks more frequently than the utility allows, the utility puts the application to sleep for a short period. DOSKBD runs constantly, and its default values (which you can see by typing

DOSKBD

at the command prompt) apply to every DOS window. Table A explains DOSKBD's configurable switches, which can have values ranging from 0 to 32,767 (7FFF in hexadecimal form).

If you want to modify any of the default values, you need to specifically apply those values to the window in which the DOS application will run. Making users reconfigure their application's keyboard polling is contrary to the low-management paradigm of thin-client computing, so you must devise a means of running the utility before running the application. Either create a batch file that includes the application and DOSKBD with the appropriate settings, or edit autoexec.nt to include the correct values.

To see how your changes are working, you can use three more DOSKBD switches to monitor keyboard polling:

  • /DetectionInterval:nnn—sets the length of time (in clock ticks) that you'll monitor polling events
  • /StartMonitor [applicationname]—tells DOSKBD to start gathering polling statistics
  • /StopMonitor—tells DOSKBD to stop gathering polling statistics and display the

Related Content:

ARTICLE TOOLS

Comments
  • Anonymous User
    8 years ago
    Nov 21, 2004

    Where do you get DOSKBD and does it work for XP networks?

  • Casey Mullineaux
    8 years ago
    Apr 05, 2004

    Indeed a fantastic article. As an IT Administrator for a large company, it solved a major problem i was having with 40 odd systems running Microsoft Fox Pro.

  • Steve Friesner
    9 years ago
    Nov 14, 2003

    THANKS!!!!!!!!!!!!!
    Ive been trying to figure out WHY my old dos program ran like crap on a novell server with XP & 98 Workstations... I adjusted the Idle Sens... now the ap works faster AND it does not take 2 hours for the program to print a simple 4 page report.

  • Alejandro Romero
    12 years ago
    May 16, 2000

    Great Article it really helped me with my MS-Dos Application Problem

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.