Like this CertiGuide? Get it in PDF format!
Click Here!

Custom Search







Table Of Contents  CertiGuide to A+ (A+ 4 Real)
 9  Chapter 7: History, Installing and Use of the MacOS
      9  You are Booted Up, Now What?

Previous Topic/Section
Multitasking and the Mac
Previous Page
Pages in Current Topic/Section
1
Next Page
Pre-Emptive Multitasking and Protected Memory
Next Topic/Section

Context Switching

As the Mac began to acquire more RAM, the engineers at Apple gave us the Switcher. The Switcher permitted more than one program or application to be active in memory at any one time. To put this into perspective, it allowed the user have more than one program open at a time, and to switch between them, an approach called context switching. It is important here to point out that with context switching, these programs were not running simultaneously, they were operating one at a time. The Switcher simply stored the state of one program while restoring the other, as well as switching the user’s context.

Figure 384: Context Switching

 


Later, the context-switching concept evolved into a service called MultiFinder. Initially MultiFinder performed the pretty much the same functions. As MultiFinder became more developed, and more OS support was provided, an ideal was born, supporting cooperative multitasking. With cooperative multitasking, the OS was altered in such a way that each time the GetNextEvent was ordered, instead of simply updating the internal events and happenings, the OS also allows other programs and applications to update as well. In order for this to work, every program running had to cooperate with the operating system, and allow it to perform the required updates. If any application stopped ordering GetNextEvent, the processor would just continue with that program’s codes until the next GetNextEvent called, or until the program quit. In cooperative multitasking, there was no way for the OS to interrupt a program. This was not a great way to work, since the only control the user had was over the mouse, as nothing else will work when an application is behaving this way. No mouse clicks or keyboard actions will work when the program has “locked up” the processor this way, since the operating system itself is powerless.

The Main Event

Those of us who can remember the 80s might remember programs that utilized a “main event loop”. This was code that ran hundreds of times a second, and the a command, specifically the ìGetNextEventî would interact with the rest of the OS, stopping the current program and passing control of the computer to the operating system. At this point, the OS saves the microprocessor state and the program counter. As soon as the OS is done, it reports to the program what activities were performed, and then the program can make any appropriate changes and move on.


There are also behaviors very common to cooperative multitasking seen in other operating systems in use today. For example, in Microsoft Windows 95, as with Mac OS 9, when a program controls the main event loop, it can control the entire system, so that no other program, not even the OS, can process any event if the controlling application does not release the event loop. We see this in Win95 when we get popup dialog boxes that must be dismissed by clicking OK or Cancel. In the case where a program controlling the main event loop will not release, the box will remain on the screen, preventing all other background applications and activities from functioning until it is dismissed.

Throughout the years, the GetNextEvent was refashioned and even later supplanted with several replacements. These replacements allowed applications to assign their own significance in the operating order within the operating system, and allow these programs to determine then exactly what their level of importance was in relation to each other. For example, the game you are playing may want top priority, while the word processing software you are ignoring may set itself lower on the totem pole of programs at that moment in time.


Previous Topic/Section
Multitasking and the Mac
Previous Page
Pages in Current Topic/Section
1
Next Page
Pre-Emptive Multitasking and Protected Memory
Next Topic/Section

If you find CertiGuide.com useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider buying an inexpensive PDF equivalent of the CertiGuide to A+ (A+ 4 Real) from StudyExam4Less.com. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $



Home - Table Of Contents - Contact Us

CertiGuide to A+ (A+ 4 Real) (http://www.CertiGuide.com/apfr/) on CertiGuide.com
Version 1.0 - Version Date: March 29, 2005

Adapted with permission from a work created by Tcat Houser et al.
CertiGuide.com Version Copyright 2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.