Solved

Multitasking in Windows 3.11

Posted on 1997-08-20
3
746 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

16 Experts available now in Live!

Get 1:1 Help Now