Solved

Multitasking in Windows 3.11

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Duplicates in Aggregate Query 3 39
Handle Exceptions during instantiation 28 414
Fix insertion and shifting issue 5 62
Explain Unit of Work pattern 2 62
This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

815 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

7 Experts available now in Live!

Get 1:1 Help Now