Q1 consider a computer system with a single processor with

Assignment Help Theory of Computation
Reference no: EM13357477

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?

Reference no: EM13357477

Questions Cloud

Topics1personality amp valuesnbsp2motivation concepts : topics1personality amp valuesnbsp2motivation concepts nbsp3perception amp individual decision
Cloud computing to the rescuewrite a two to three 4-5 page : cloud computing to the rescuewrite a two to three 4-5 page paper in which you1. describe the hardware software and
1nbspnbspnbsp what factors caused the global financial : 1.nbspnbspnbsp what factors caused the global financial crisis? describe three factors in detail. you need to reference
Write a c matrix multiplication program which you can : write a c matrix multiplication program which you can instrument to monitor and measure execution time as a function of
Q1 consider a computer system with a single processor with : q.1. consider a computer system with a single processor with a single core. there are two processes to run in the
Give answers for below questions in detailnbsp nbsp nbsp : give answers for below questions in detail....nbsp nbsp nbsp nbspa show how to find equilibrium in an rc model
Define the economics terms below for nbspnbspnbspnbspnbsp a : define the economics terms below for ..nbspnbspnbspnbspnbsp a nbspnational accounting identity.nbspnbspnbspnbspnbsp b
Question 1 the table sets out the demand and supply : question 1 the table sets out the demand and supply schedules for banana.pricenbspdollars per boxnbspquantity
A proactive strategic procurement operation can give the : a proactive strategic procurement operation can give the organisation it represents a competitive advantage by reducing

Reviews

Write a Review

Theory of Computation Questions & Answers

  Question about perfect programming language

I have noticed that there are several languages, is this because no one language has all the main elements needed to be a perfect programming Language?

  Compute a shortest superstring

Dynamic programming algorithm to compute a shortest superstring.

  Express set as regular expression

Express the following set as a regular expression: The set of all strings of length at least three over {0,1} such that every three consecutive.

  Modify the syntax of a programming language

Sometimes it is necessary to modify the syntax of a programming language. This is done by changing the CFG that the language uses. What changes would have to be made to ac's CFG (Figure) to implement the following changes?

  Argue that the problem is np complete

Argue that the following prob is NP Complete. Given list of positive integers, u1,u2,...un (in binary representation) and asked if there is partition of this set into 3 subsets, each of which has same sum.

  Proving language to be pumping lemma

Show that the language F = {a^i b^j c^k | i, j, k greater than or equal to 0 and if i = 1 then j = k} is not regular. Show, however, that it satisfies the statement of the pumping lemma

  Show polynomial-time algorithm for gdp

Goal is to find expedition of maximum profit. Either show that there exists polynomial-time algorithm for GDP, or show that corresponding decision problem is NP-complete.

  Create mealy type state machine with input and output

Create the Mealy type state machine with input X and output Y. Y must be 1 whenever sequence 110 or 101 has been detected on X on last 3 consecutive rising clock edges.

  Subset-sum problem

Calculate some number x= Sum - 2K. Create new set A by add x to the set B {b1, b2,....., bn} U {x}, where the summation now is B+x. it is possible to split the numbers in A into some subsets iff they can summing up to K:

  Construct a dfa that recognizes languages

Construct a DFA that recognizes each of the following languages. Unless otherwise noted we are assuming that ω ∈ {0,1}*. (A drawing of a state diagram is sufficient.)

  Create a finite-state machine design to turn your fpga

create a finite-state machine design to turn your fpga development board into a simple programmable music box. the

  How to express correctness properties in ltl

Express the given correctness properties in LTL. Defne propositions/variables to model the events mentioned in the question. If a parent process calls the blocking waitpid() system call then it is blocked until child process terminates.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd