Solved

Multitasking in Windows 3.11

Posted on 1997-08-20
3
769 Views
Last Modified: 2013-12-03
The system I'm working on is running in Windows 3.11.  It was written to be a multitasking system consisting of six DOS apps and one Windows app.  These apps though, were NOT written to be cooperatively multitasked, they are each a continuous loop and at no time release the processor.  Somehow the system has been working but the question remains, if the apps don't release the processor, how does it get passed onto the next task?  I've been hearing that windows grabs the processor from a task when it executes I/O operations, is that true and what operations do allow windows to pass the processor on?
0
Comment
Question by:bradyd
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 200 total points
ID: 1404574
Windows 3.1x really supports two types of multitasking: cooperative and preemptive.

Cooperative multitasking is applied among Windows applications and it is based on the GetMessage() API. Whenever an app calls GetMessage() Windows checks if there are new messages to be delivered to the app's message loop: if there are not, it doesn't return to the caller - it passes the control to another Windows app waiting to be executed.
As long as all Windows apps regularly call GetMessage() this works well; one common way to get the full processor power was to get messages with PeekMessage() which instead *does* return to the caller if no new messages are found.

Preemptive multitasking (yes, the same that rules under Windows 95 and NT) is applied only to DOS sessions, because they assume to be running in a monotask environment and by no means could yield the control to other processes.
Preemptive multitasking means that each program is associated an amount of exexution time after which the scheduler automatically yields the control to another app.

This is how Win3.1 multitasking works.

Davide Marcato.
0
 

Author Comment

by:bradyd
ID: 1404575
I would still like to know if any other calls, like writing to a file, from the windows apps, besides GetMessage() and PeekMessage(), can yeild the processor in the windows app.
Also, where do you setup the amount of exexution time after which the scheduler automatically yields the control to another app?
Is there a book or web site that you could recommend for this type of information?

Thanks!
0
 
LVL 4

Expert Comment

by:davmarc
ID: 1404576
Maybe I/O yields processor too...I don't remember now, I haven't worked with Win16 apps for one and a half years. You can test it quite easily though, just run one never-yelding Win app and do some disk operations from time to time: if other apps do something from time to time this is true.

Under Windows 3.1x you can set it in Control Panel.
Under Win95/NT it is decided by the o.s.

It's hard to find such info today, because Win3.1 programming is mostly obsolete. Maybe searching old magazines and old MSDN CDs...On the Web search with one of the engine, perhaps you'll be able to find something.

Davide Marcato.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

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 most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 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