• Home
  • Textbooks
  • Computers as Components: Principles of Embedded Computing System Design
  • Processes and Operating Systems

Computers as Components: Principles of Embedded Computing System Design

Marilyn Wolf

Chapter 6

Processes and Operating Systems - all with Video Answers

Educators


Chapter Questions

01:07

Problem 1

Identify activities that operate at different rates in
a. a DVD player;
b. a laser printer;
C. an airplane.

Jodi Folley
Jodi Folley
Numerade Educator
00:53

Problem 2

Name an embedded system that requires both periodic and aperiodic computation.

Christopher Stanley
Christopher Stanley
Numerade Educator
06:52

Problem 3

An audio system processes samples at a rate of $44.1 \mathrm{kHz}$. At what rate could we sample the system's front panel to both simplify analysis of the system schedule and provide adequate response to the user's front panel requests?

James Kiss
James Kiss
Numerade Educator

Problem 4

Draw a UML class diagram for a process in an operating system. The process class should include the necessary attributes and behaviors required of a typical process.

Check back soon!
01:18

Problem 5

Draw a task graph in which P1 and P2 each process separate inputs and then pass their results onto $\mathrm{P} 3$ for further processing.

Calin Lupas
Calin Lupas
Numerade Educator

Problem 6

Compute the utilization for these task sets:
a. $\mathrm{P} 1$ : period $=1 \mathrm{~s}$, execution time $=10 \mathrm{~ms} ; \mathrm{P} 2$ : period $=100 \mathrm{~ms}$, execution time $=10 \mathrm{~ms}$
b. P1: period $=100 \mathrm{~ms}$, execution time $=25 \mathrm{~ms}$; P2: period $=80 \mathrm{~ms}$, execution time $=15 \mathrm{~ms} ; \mathrm{P} 3$ : period $=40 \mathrm{~ms}$, execution time $=5 \mathrm{~ms}$.
c. P1: period $=10 \mathrm{~ms}$, execution time $=1 \mathrm{~ms} ; \mathrm{P} 2$ : period $=1 \mathrm{~ms}$, execution time $=0.2 \mathrm{~ms} ; \mathrm{P} 3$ : period $=0.2 \mathrm{~ms}$, execution time $=0.05 \mathrm{~ms}$.

Check back soon!

Problem 7

What factors provide a lower bound on the period at which the system timer interrupts for preemptive context switching?

Check back soon!

Problem 8

What factors provide an upper bound on the period at which the system timer interrupts for preemptive context switching?

Check back soon!
01:22

Problem 9

What is the distinction between the ready and waiting states of process scheduling?

Hubert Agamasu
Hubert Agamasu
Numerade Educator

Problem 10

A set of processes changes state as shown over the interval $[0,1 \mathrm{~ms}]$. P1 has the highest priority and P3 has the lowest priority. Draw a UML sequence diagram showing the state of all the processes during this interval.
$$
\begin{array}{|ll|}
\hline \mathbf{t} & \text { Process states } \\
0 & P 1=\text { waiting, } P 2=\text { waiting, } P 3=\text { executing } \\
0.1 & P 1=\text { ready } \\
0.15 & P 2=\text { ready } \\
0.2 & P 1=\text { waiting } \\
0.3 & P 1=\text { ready, } P 3=\text { ready } \\
0.4 & P 1=\text { waiting } \\
0.5 & P 2=\text { waiting } \\
0.6 & P 3=\text { waiting } \\
0.8 & P 2=\text { ready, } P 3=\text { ready } \\
0.9 & P 2=\text { waiting } \\
\hline
\end{array}
$$

Check back soon!
01:39

Problem 11

Provide examples of
a. blocking interprocess communication;
b. nonblocking interprocess communication.

James Kiss
James Kiss
Numerade Educator

Problem 12

For the following periodic processes, what is the shortest interval we must examine to see all combinations of deadlines?
a. $$
\begin{array}{|l|c|}
\hline \text { Process } & \text { Deadline } \\
\hline \text { P1 } & 2 \\
\text { P2 } & 5 \\
\text { P3 } & 10 \\
\hline
\end{array}
$$
b. $$
\begin{array}{|l|c|}
\hline \text { Process } & \text { Deadline } \\
\hline \text { P1 } & 2 \\
\text { P2 } & 4 \\
\text { P3 } & 5 \\
\text { P4 } & 10 \\
\hline
\end{array}
$$
c.
d. $$
\begin{array}{|l|c|}
\hline \text { Process } & \text { Deadline } \\
\hline \text { P1 } & 3 \\
\text { P2 } & 4 \\
\text { P3 } & 5 \\
\text { P4 } & 6 \\
\text { P5 } & 10 \\
\hline
\end{array}
$$

Check back soon!

Problem 13

Consider the following system of periodic processes executing on a single $\mathrm{CPU}$ (P1 has the highest priority and $\mathrm{P} 4$ the lowest):
$$
\begin{array}{|l|l|l|}
\hline \text { Process } & \text { Execution time } & \text { Deadline } \\
\hline \text { P1 } & 4 & 200 \\
\text { P2 } & 1 & 10 \\
\text { P3 } & 2 & 40 \\
\text { P4 } & 6 & 50 \\
\hline
\end{array}
$$
Can we add another instance of P1 to the system and still meet all the deadlines using RMS?

Check back soon!

Problem 14

Given the following set of periodic processes running on a single CPU (P1 has highest priority), what is the maximum execution time of P5 for which all the processes will be schedulable using RMS?
$$
\begin{array}{|lll|}
\hline \text { Process } & \text { Execution time } & \text { Deadline } \\
\hline \text { P1 } & 1 & 10 \\
\text { P2 } & 18 & 100 \\
\text { P3 } & 2 & 20 \\
\text { P4 } & 5 & 50 \\
\text { P5 } & x & 25 \\
\hline
\end{array}
$$

Check back soon!

Problem 15

A set of periodic processes is scheduled using RMS; P1 has the highest priority. For the process execution times and periods shown below, show the state of the processes at the critical instant for each of these processes.
a. P1
b. P2
c. $\mathrm{P} 3$
$$
\begin{array}{|c|c|c|}
\hline \text { Process } & \text { Time } & \text { Deadline } \\
\hline \text { P1 } & 1 & 4 \\
\hline \text { P2 } & 1 & 5 \\
\hline \text { P3 } & 1 & 10 \\
\hline
\end{array}
$$

Check back soon!

Problem 16

For the given periodic process execution times and periods ( $\mathrm{P} 1$ has the highest priority), show how much CPU time of higher-priority processes will be required during one period of each of the following processes:
a. P1
b. P2
c. $\mathrm{P} 3$
d. $\mathrm{P} 4$
$$
\begin{array}{|c|c|c|}
\hline \text { Process } & \text { Time } & \text { Deadline } \\
\hline \mathrm{P} 1 & 1 & 5 \\
\hline \text { P2 } & 2 & 10 \\
\hline \text { P3 } & 2 & 25 \\
\hline \text { P5 } & 5 & 50 \\
\hline
\end{array}
$$

Check back soon!

Problem 17

For the periodic processes shown below:
a. Schedule the processes using an RMS policy.
b. Schedule the processes using an EDF policy.
In each case, compute the schedule for an interval equal to the leastcommon multiple of the periods of the processes. P1 has the highest priority and time starts at $\mathrm{t}=0$.
$$
\begin{array}{|l|l|l|}
\hline \text { Process } & \text { Time } & \text { Deadline } \\
\hline \text { P1 } & 1 & 3 \\
\text { P2 } & 1 & 4 \\
\text { P3 } & 1 & 12 \\
\hline
\end{array}
$$

Check back soon!

Problem 18

For the periodic processes shown below:
a. Schedule the processes using an RMS policy.
b. Schedule the processes using an EDF policy.
In each case, compute the schedule for an interval equal to the leastcommon multiple of the periods of the processes. P1 has the highest priority and time starts at $\mathrm{t}=0$.
$$
\begin{array}{|l|l|l|}
\hline \text { Process } & \text { Time } & \text { Deadline } \\
\hline \text { P1 } & 1 & 3 \\
\text { P2 } & 1 & 4 \\
\text { P3 } & 2 & 6 \\
\hline
\end{array}
$$

Check back soon!

Problem 19

For the periodic processes shown below:
a. Schedule the processes using an RMS policy.
b. Schedule the processes using an EDF policy.
In each case, compute the schedule for an interval equal to the least-common multiple of the periods of the processes. P1 has the highest priority and time starts at $t=0$.
$$
\begin{array}{|l|l|l|}
\hline \text { Process } & \text { Time } & \text { Deadline } \\
\hline \text { P1 } & 1 & 2 \\
\text { P2 } & 1 & 3 \\
\text { P3 } & 2 & 10 \\
\hline
\end{array}
$$

Check back soon!

Problem 20

For the given set of periodic processes, all of which share the same deadline of 12 :
a. Schedule the processes for the given arrival times using standard ratemonotonic scheduling (no data dependencies).
b. Schedule the processes taking advantage of the data dependencies. By how much is the CPU utilization reduced?
$$
\begin{array}{|l|l|}
\hline \text { Process } & \text { Execution time } \\
\hline P 1 & 2 \\
P 2 & 1 \\
P 3 & 2 \\
\hline
\end{array}
$$

Check back soon!
00:56

Problem 21

For the periodic processes given below, find a valid schedule
a. using standard RMS;
b. adding one unit of overhead for each context switch.

Shital Rijal
Shital Rijal
Numerade Educator

Problem 22

For the periodic processes and deadlines given below:
a. Schedule the processes using RMS.
b. Schedule using EDF and compare the number of context switches required for EDF and RMS
$$
\begin{array}{|lll|}
\hline \text { Process } & \text { Time } & \text { Deadline } \\
\hline \text { P1 } & 1 & 5 \\
\text { P2 } & 1 & 10 \\
\text { P3 } & 2 & 20 \\
\text { P4 } & 10 & 50 \\
\text { P5 } & 7 & 100 \\
\hline
\end{array}
$$

Check back soon!

Problem 23

If you wanted to reduce the cache conflicts between the most computationally intensive parts of two processes, what are two ways that you could control the locations of the processes' cache footprints?

Check back soon!

Problem 24

A system has two processes $\mathrm{P} 1$ and $\mathrm{P} 2$ with $\mathrm{P} 1$ having higher priority. They share an $\mathrm{I} / \mathrm{O}$ device $\mathrm{ADC}$. If $\mathrm{P} 2$ acquires the $\mathrm{ADC}$ from the RTOS and $\mathrm{P} 1$ becomes ready, how does the RTOS schedule the processes using priority inheritance?

Check back soon!
02:21

Problem 25

Explain the roles of interrupt service routines and interrupt service handlers in interrupt handling.

Sanchit Jain
Sanchit Jain
Numerade Educator
01:10

Problem 26

What are the kernel-level units of execution in WinCE?

Adam Conner
Adam Conner
Numerade Educator

Problem 27

Draw a UML state diagram for the predictive shutdown mechanism of a cell phone. The cell phone wakes itself up once every five minutes for 0.01 second to listen for its address. It goes back to sleep if it does not hear its address or after it has received its message.

Check back soon!
10:00

Problem 28

How would you use the ADPCM method to encode an unvarying (DC) signal with the coding alphabet $\{-3,-2,-1,1,2,3\}$ ?

Bryan Lynn
Bryan Lynn
Numerade Educator