Prelab 5 : Operating SystemsThis lab was originally developed by Tammy Bailey Reading
Operating SystemsThe operating system is the most important program that runs on a computer. Every general-purpose computer must have an operating system to run other programs. Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, and controlling peripheral devices such as disk drives and printers. Show Operating systems can be classified as follows: Operating systems provide a software platform on top of which other programs, called application programs, can run. The application programs must be written to run on top of a particular operating system. Your choice of operating system, therefore, determines to a great extent the applications you can run. For example, Microsoft Word is an application that runs on the Windows operating system, but not on the Linux operating system. As a user, you normally interact with the operating system through a set of commands. For example, the UNIX operating system contains commands such as cp and mv for copying files and changing the names of files, respectively. The commands are accepted and executed by a part of the operating system called the command processor or command line interpreter. Graphical user interfaces allow you to enter commands by pointing and clicking at objects that appear on the screen, as in the Windows operating system. [ www.webopedia.com] ProcessesA task or process refers to the combination of a program being executed and bookkeeping information used by the operating system. For large multi-user and multitasking systems, the operating system has even greater responsibilities and powers. It is like a traffic cop -- it makes sure that different processes and users running at the same time do not interfere with each other. Processes running concurrently are often in contention for resources, like memory or processor time. Often only one process can have a certain resource at a time. Part of the operating system's job, then, is to decide a strategy for giving access to these resources. [ www.webopedia.com] ThreadsYou are already likely most familiar with the idea of sequential programs. That is, each has a beginning, an execution sequence, and an end. At any given time during the runtime of the program, there is a single point of execution. A thread is similar to the sequential programs described previously. A single thread also has a beginning, a sequence, and an end and at any given time during the runtime of the thread, there is a single point of execution. However, a thread itself is not a program; it cannot run on its own. Rather, it runs within a program. The following figure shows this relationship.
Definition: A thread is a single sequential flow of control within a program. There is nothing new in the concept of a single thread. The real hoopla surrounding threads is not about a single sequential thread. Rather, it's about the use of multiple threads in a single program, running at the same time and performing different tasks. This is illustrated by the following figure:
A modern web browser is an example of a multithreaded application. Within the browser, you can scroll a page while it's downloading an applet or image, play animation and sound concurrently, print a page in the background while you download a new page, or watch three sorting algorithms race to the finish. You are used to life operating in a concurrent fashion...so why not your browser? Some texts use the name lightweight process instead of thread. A thread is similar to a real process in that a thread and a running program are both a single sequential flow of control. However, a thread is considered lightweight because it runs within the context of a full-blown program and takes advantage of the resources allocated for that program and the program's environment. As a sequential flow of control, a thread must carve out some of its own resources within a running program. (It must have its own execution stack and program counter for example.) The code running within the thread works only within that context. Thus, some other texts use execution context as a synonym for thread. [ java.sun.com] Questions
What allows multiple programs to run on a computer?Multiprocessing: Supports running a program on more than one CPU. Multitasking: Allows more than one program to run concurrently. Multithreading: Allows different parts of a single program to run concurrently.
Can you have two operating systems running at the same time?Most computers can be configured to run more than one operating system. Windows, macOS, and Linux (or multiple copies of each) can happily coexist on one physical computer.
|