### Considering a single programmed operating system

Assignment Help Theory of Computation
##### Reference no: EM1321418

Q.1. Consider a computer system with a single processor with a single core. There are two processes to run in the system: P1 and P2. Process P1 has a life cycle as  follows: CPU burst time of 15 units, followed by I/O burst time of minimum 10 units, followed by CPU burst time of 10 units. Process P2 has the following life cycle: CPU burst time of 10 units, followed by I/O burst time of minimum 5 units, followed by CPU burst time of 15 units. Now answer the following questions:

a) Considering a single programmed operating system, what is the minimal total time required to complete executions of the two processes? You should explain your answer with a diagram.

b) Now considering a multiprogrammed operating system, what is the minimal total time required to complete executions of the two processes? You should explain your answer with a diagram.

c) Throughput is defined as the number of processes (tasks) completed per unit time. Following this definition, calculate the throughputs for parts a) and b) above. How does multiprogramming affect throughput? Explain your answer.

Q.2. Suppose that a multiprogrammed system has a load of N processes with individual execution times of t1, t2, …,tN. Answer the following questions:

a) How would it be possible that the time to complete the N processes could be as small as: maximum (t1, t2, …,tN)?

b) How would it be possible that the total execution time, T > t1+ t2+ …+tN? In other words, what would cause the total execution time to exceed the sum of individual process execution times?

Q.3. Consider a computer running in the user mode. It switches to the monitor mode (also known as kernel mode) whenever an interrupt or trap occurs, jumping to the address determined from the interrupt vector. A malicious user took advantage of a certain serious loophole in the computer's protection mechanism, by which the user could run his/her own program in the  monitor mode! This can have disastrous consequences.

a) What could have the user possibly done to achieve this?

b) What disastrous consequences could it cause?

c) Suggest a remedy for the loophole.

Q.4. Consider a preemptive operating system where processes have priorities and a running process gets preempted (i.e., forced to leave the CPU) as soon as a higher priority process is ready to run.

The life cycle of a process, other than the very first process, begins with a "spawn" by another process and ends with either a regular "exit" by the process or a "terminate (process_id)" command by another process of equal or higher priority.

Each process is assigned an initial priority at spawn time and this priority remains unchanged during the entire life cycle. There are system resources, both hardware and software, for which a process can block if the resource is not free. A process can also be suspended by another process of equal or higher priority through the call "suspend (process_id)''. A suspended process is resumed by the call "resume (process_id)''. Note that a process can be in any state (i.e., running, blocked or ready) when suspended.

Processes communicate with one another via "send'' and "receive'' message passing primitives. "Receive'' is always blocking, i.e., the calling process blocks if the message is not available. "Send'' is always non-blocking. Illustrate the complete life-cycle of a process with the help of a process state transition diagram.

Q.5. When there is a context switch from one process to another, the OS kernel invokes the function ContextSwitch which saves the context of the currently executing process into its PCB and then inserts the process to an appropriate queue (i.e., ready queue or a blocked queue). It is necessary that ContextSwitch is atomic (i.e., unbreakable: either done or not-done;nothing in between). Explain the following:

a) Why must ContextSwitch be atomic?

b) How can it be made atomic in practice?

### Previous Q& A

#### Find the sample size in order to obtain p estimate

How large sample should be selected in order to obtain p estimate with a bound of 0.08 on the error of estimation.

#### Explaining level of significance in two-tailed test

Compute test statistic for sample data that you would use to test whether sample mean varies from population mean of 10 pounds at a 5 percent level of significance in two-tailed test.

#### Test the significant difference between two mean

We recalculated our comparison of ideal number of children, this time only for women, separating them into two groups, those who indicated that they were "very happy" or "not at all happy" with life.

#### Determining probability of two or more fatalities

For patients over age 80, probability is 0.05 that coronary bypass patient will die soon after surgery, if hospital performs eight such operations, determine the probability of two or more fatalities?

#### Test of the difference between proportions

Use a test of the difference between proportions when answering these questions.

#### Writing formal commentary of results of test

Based on this sample, is Moe correct in his assertion? Write up formal commentary of results of your test.

#### Computing odds of flipping three tails

A fair coin is flipped 3 times. Compute the odds of flipping 3 tails.

#### What is the equilibrium cost of a car stereo

Illustrate what is the equilibrium cost of a car stereo also illustrate what is the equilibrium quantity of car stereos per day.

#### Show how to find equilibrium in an rc model

Show how to find equilibrium in an RC model? What is the relationship between the marginal rate of substitution between leisure and labor and the marginal product of labor in the RC model.

#### Find the regression coefficients

Find the regression coefficients.

### Similar Q& A

#### Design unambiguous grammar to parse expressions

Write a program would read two numbers and then print all numbers between the first and the second, inclusive. Design unambiguous grammar to parse expressions

#### Redundant sequence identi cation

Redundant sequence identi cation

#### Finite-state machine design

Create a finite-state machine design to turn your FPGA development board into a simple programmable music box.

#### Compute a shortest superstring

Dynamic programming algorithm to compute a shortest superstring.

#### Consider a logic function with three outputs

Consider a logic function with three outputs,  A ,  B , and  C , and three inputs,  D ,  E , and  F . The function is defined as follows:  A  is true if at least one input is true,  B  is true

#### Propositional and predicate logic

Write down a structural induction principle for the PlayTree free type

#### Design a syntactic analyzer

Design a syntactic analyzer for the language specified by the grammar