Solved

Multitasking in Windows 3.11

Posted on 1997-08-20
3
737 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

10 Experts available now in Live!

Get 1:1 Help Now