• Please review our updated Terms and Rules here

Windows 3.1 386 enhanced mode DOS question

alank2

Veteran Member
Joined
Aug 3, 2016
Messages
2,265
Location
USA

mentions:

The capability for pre-emptive multitasking of DOS sessions

Then on another page I read something about single tasked DOS.

Can Windows 3.1 in 386 enhanced mode have two DOS windows running at the same time? I started up a dir/s in two of them and only the active one runs, the other seems to be paused until it is the active window.
 
Windows 3.1 has no kernel capable of pre-emptive multitasking, but it can do cooperative multitasking. Which means, you can multitask as long all the programs involved release control regularly in a cooperative mode.

I remember running several COMMAND.COM windows concurrently in Windows 3.1, but I don't remember if the non-focused one went frozen or it run in the background doing things. Probably not really important for my use case, as a WordPerfect 5.1 in a COMMAND.COM window in Windows 3.1 does not care about being frozen when is not being used, anyway.
 
Windows 3.x Enhanced mode does preemptively multitask between DOS VMs. One VM is assigned to Windows applications which are cooperatively multitasked. Each DOS application gets its own VM and time is sliced between all the VMs. Windows 2.x/386 works the same way except that the Windows 2 session will be in real mode.

In standard mode, either protected mode Windows applications will run cooperatively or the single DOS application with focus will run. Other DOS applications will be swapped to disk and thus not running.

Real mode and Windows 1.x and 2.x (excluding 386 mode) will attempt to cooperatively multitask both Windows applications and DOS applications. Sometimes, this even works.
 
I installed WFWG 3.11 in a VMware DOS box and only the active DOS window will run, but not both at the same time, or either if program manager takes focus. It will only run in enhanced mode, but why don't both DOS windows run at the same time?
 
Check the PIF file settings to determine the amount of CPU given to each VM. Note that if one has 2 DOS sessions and Windows, each VM might only get 1/3 of the total CPU which can be quite wasteful for DOS sessions that have no operations. There are API calls that allow a DOS session to give up excess portions of its time slice but almost nothing implements that.

The PIF editor includes options for BACKGROUND and EXCLUSIVE. Background permits it to run in the Background; Exclusive means no other program runs in the background when the focus is on that app. Advanced options permit a more exacting specification of how the VM runs. https://www.tech-insider.org/windows/research/acrobat/920221/3PIFW.pdf looks like the chapter from the WRK on using PIFs and by extension multitasking DOS apps.

Disk access can be delayed because different applications can't access the disk at the same time. Running a BASIC program with a loop that updates the screen while running a second DOS session with a DIR command might be a good test if the VM settings are correct.
 
That was it - editing the PIF and now both are running - thanks!
 
Back
Top