Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multitasking in Windows 3.11

Posted on 1997-08-20
3
Medium Priority
?
816 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
davmarc earned 600 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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 this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

719 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