11.07.2015 Views

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

324 multitasking“local” memory within the cluster, maintaining coherencethrough bus monitoring is impracticable. Instead, memoryis usually organized into data objects that are distributedoptimally to reduce the necessity for remote access, <strong>and</strong>the objects are shared by CPUs requesting them through adirectory system.MultiprogrammingIn order for a program to take advantage <strong>of</strong> the ability to runon multiple CPUs, the operating system must have facilitiesto support multiprocessing, <strong>and</strong> the program must be structuredso its various tasks are most efficiently distributedamong the CPUs. These separate tasks are generally calledthreads. A single program can have many threads, eachexecuting separately, perhaps on a different CPU, althoughthat is not required.The operating system can use a number <strong>of</strong> approachesto scheduling the execution <strong>of</strong> processes or threads. It cansimply assign the next idle (available) CPU to the thread.It can also give some threads higher priority for access toCPUs, or let a thread continue to “own” its CPU until it hasbeen idle for some specified time.The use <strong>of</strong> threads is particularly natural for applicationswhere a number <strong>of</strong> activities must be carried onsimultaneously. For example, a scientific or process controlapplication may have a separate thread reading the databeing returned from each instrument, another thread monitoringfor alarm conditions, <strong>and</strong> other threads generatinggraphical output.Threads also allow the user to continue interacting witha program while the program is busy carrying out earlierrequests. For example, the user <strong>of</strong> a Web browser can continueto use menus or navigation buttons while the browseris still loading graphics needed for the currently displayedWeb page. A search program can also launch separatethreads to send requests to multiple search engines or toload multiple pages.Support for multiprogramming <strong>and</strong> threads can now befound in versions <strong>of</strong> most popular programming languages,<strong>and</strong> some languages such as Java are explicitly designed toaccommodate it.Multiprogramming <strong>of</strong>ten uses groups or clusters <strong>of</strong> separatemachines linked by a network. Running s<strong>of</strong>tware onsuch systems involves the use <strong>of</strong> communications protocolssuch as the MPI (message-passing interface). This programminginterface has been widely deployed on many platformsfor use with languages such as C/C++ <strong>and</strong> Fortran.Another popular programming interface is OpenMP, whichfeatures the allocation <strong>of</strong> execution threads <strong>and</strong> the distribution<strong>of</strong> work among them.A Multiprocessed WorldThe dem<strong>and</strong> for s<strong>of</strong>tware that can efficiently use multipleprocessors is likely for some time to outstrip the supply <strong>of</strong>programmers who can “think in parallel.” One reason isthat today most new PCs have two processing “cores,” withfour-core systems available <strong>and</strong> more to come (see microprocessor).This means that many mainstream applicationswill eventually need to be rewritten for the newhardware environment. Another factor is that as the priceper processor continues to decline <strong>and</strong> high-end multiprocessingmachines are reaching 1 “petaflop” (1 quadrillionoperations per second), many supercomputer applicationswill also need to be rewritten.Meeting this dem<strong>and</strong> not only takes training, it alsotakes appropriate languages <strong>and</strong> other tools. In recentyears, therefore, the Defense Advanced Research ProjectsAgency (DARPA) has funded research in “High Productivity<strong>Computer</strong> Systems” by such companies as Cray, Sun,<strong>and</strong> IBM. New languages built “from the ground up” formultiprocessing include Sun’s Fortress, Cray’s Chapel, <strong>and</strong>IBM’s new project, code-named X10. Ultimately, systemsfor developing multiprocessing s<strong>of</strong>tware should take most<strong>of</strong> the architectural details <strong>of</strong>f the h<strong>and</strong>s <strong>of</strong> the programmer,allowing performance to smoothly “scale up” with theincreasing number <strong>of</strong> processors.Further ReadingAnthes, Gary. “Languages for Supercomputing Get ‘Suped’ Up.”<strong>Computer</strong>world, March 12, 2007. Available online. URL:http://www.computerworld.com/action/article.do?comm<strong>and</strong>=viewArticleBasic&articleId=283477. Accessed April 5, 2007.Culler, David E., <strong>and</strong> Jaswinder Pal Singh. Parallel <strong>Computer</strong> Architecture:A Hardware/S<strong>of</strong>tware Approach. San Francisco: MorganKaufmann, 1999.Dongara, Jack, et al., eds. Sourcebook <strong>of</strong> Parallel Computing. SanFrancisco: Morgan Kaufmann, 2003.Feldman, Michael. “Our Manycore Future.” HPC Wire. Availableonline. URL: http://www.hpcwire.com/hpc/1295541.html.Accessed April 5, 2007.Merritt, Rick. “Where Are the Programmers? Enrollment WanesJust as <strong>Computer</strong> Scientists Grapple with Problem <strong>of</strong> Parallelism.”EE Times, March 12, 2007. Available online. URL:http://www.eetimes.com/showArticle.jhtml?articleID=197801653. Accessed April 5, 2007.Quinn, Michael J. Parallel Programming in C with MPI <strong>and</strong> OpenMP.New York: McGraw-Hill, 2003.multitaskingUsers <strong>of</strong> modern operating systems such as Micros<strong>of</strong>t Windowsare familiar with multitasking, or running severalprograms at the same time. For example, a user might bewriting a document in a word processor, pause to check thee-mail program for incoming messages, type a page addressinto a Web browser, then return to writing. Meanwhile, theoperating system may be running a number <strong>of</strong> other programstucked unobtrusively into the background, such as avirus checker, task scheduler, or system resource monitor.Each running program “takes turns” using the PC’s centralprocessor. In early versions <strong>of</strong> Windows, multitaskingwas cooperative, with each program expected to periodicallyyield the processor to Windows so it could be assigned to thenext program in the queue. One weakness <strong>of</strong> this approachis that if a program crashes, the CPU might be “locked up”<strong>and</strong> the system would have to be rebooted. However, WindowsNT, 2000, <strong>and</strong> XP (as well as operating systems suchas UNIX) use preemptive multitasking. The operating systemassigns a “slice” <strong>of</strong> processing (CPU) time to a program<strong>and</strong> then switches it to the next program regardless <strong>of</strong> what

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!