This study guide will help you get ready for the final exam. It discusses the key topics in each unit, walks through the learning outcomes, and lists important vocabulary terms. It is not meant to replace the course materials!
Uniprogramming refers to computer operating systems that use one thread at a time. Multiprogramming uses more than one thread at a time and involves multicore processors.
Uniprogramming is a relatively easy OS design, such as Microsoft's MS/DOS and Apple's early Mac or Macintosh computer, which required batch processing (one thing at a time). Since this system gets rid of concurrency by defining it away, there are no concurrency issues.
In order to allow several activities to occur at the same time, such as play music, send an email, talk on the phone, Instagram, Facebook, and other social media, multiple threads of computing activity need to run concurrently. These applications have no awareness of the other computing activity that is in communion with them.
The only way to accomplish all of this activity is to make each operation function as if it is the only operation in existence. In other words, it operates as a virtual machine, which is a program on a computer that works like it is a separate computer inside the main computer. The OS manages these operations and everything else in the computing environment.
Review this material in Concurrency: Processes, Threads, and Address Spaces.
Concurrency refers to when many operations may be running at the same time, or interleaved in any arbitrary way. You should always assume several operations are running at the same time to ensure you understand the process correctly. Parallelism refers to when operations are definitely running at the same time.
Four challenges of concurrency include:
As we discussed above, a virtual machine is a program on a computer that works like it is a separate computer inside the main computer.
Wikipedia notes that a virtual machine is:
As with many things in life, computing requires managing many objectives with limited resources. If resources, such as cost and space, were unlimited we would always use parallelism. We adopt concurrency because resource constraints make parallelism unpractical. In other words, we must share resources among activities in a single computing environment.
Review this material in Concurrency: Processes, Threads, and Address Spaces and Concurrency.
A thread is an independent fetch/decode/execute loop. A thread is the definition of unique computing operation activity. A thread consumes a single address space.
We need to protect threads because they are susceptible to crashing when all of the computer programs are running. Depending on where the thread exists in the OS, a faulty thread has the potential to crash the entire OS. We can prevent threads from crashing by protecting memory, input and output (I/O), and access to the processor, such as by using a timing system.
A computer operates by what is called a "bus". Think of this as a continuous row of busses around a block, with no gaps. Information gets on and off. The whole thing is controlled by a clock within the bus. This is how the computer gets information, to and from everywhere. Everything has to fit on the bus and is controlled by the bus.
A process is a momentary creation in computing we facilitate when hardware and software work together. It may be helpful to think about a computer process in the same way as our brain when we have a single thought. A process is an abstraction in computing, because when the hardware and software stop operating or working together the abstraction disappears. Think of a process as a conception that does not persist in reality.
In other words, a process represents what is needed to run a program: it is a momentary creation in computing occasioned by the effective and productive interaction between hardware and software. We create a process to perform what we want to accomplish.
A process has two parts or goals: 1. To run computer software, and 2. To protect resources.
A process state refers to the stages a process goes through in order to execute.
Process states include:
A heavyweight process is an older understanding and use of computing OS processes where each process contains one thread and one address state. Computer engineers used this concept before they created the concept of threads.
A lightweight process is a more recent understanding of computing OS processes that introduced the concept of threads. It came about when more advanced hardware design and manufacturing allowed more code to execute during the same time period. A lightweight process allows more than one thread, but still only consumes one address space. This is a good thing.
A process is similar to a program. Think of a program as software that is not being run. Think of a process as software that is being run. So, the colloquial expression, "run the program" is somewhat inaccurate. "Run the process" is more technically accurate.
A process invokes or creates many threads. A thread is a particular, singular activity the computer engineer created to perform the unique thing they wanted by running the process. Running the process can create or invoke many threads. For example, a parent thread can generate other threads.
While you should try not to give computers human qualities, it may be helpful to think of a thread as if it were a thought.
Review this material in:
Context switching occurs when the OS switches between processes. For example, we often need to switch processes because different virtual machines are running which require access to limited resources. For optimal computing environments, the OS is the traffic cop that tells which process to run and when not to run.
Every time a context switch occurs, the OS must run and no processes will be running. Since processes produce the useful output we need and want, you can think about the OS operations between switching processes as overhead, which is wasted computing and time that allows processes to switch back and forth.
Modern OSs have more overhead because they are doing more. For example, they are running more lines of code to make the OS robust and not crash.
When computing resources are limited, such as time, money, or another practicality, single resources, such as a CPU or chip, must be shared. Context switching is a BIG part of what the OS does. Context switching is the basic idea behind multiplexing or scheduling how to share limited resources in the computing environment.
Review this material in: