Cop 4610/cgs5765, introduction to operating systems, fall 2003, florida state university.
¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾
Points : 100 points
Due : Week 9, Tuesday, October 21, 2003
Special Note: This assignment is due at the beginning of the class. No late submission for this assignment will be accepted as the solution will be made available during the class time.
1. (15 pnts) Problem 4 in the textbook on pages 322 and 323.
a. This solution forces the two cooperating processes to alternate visits to the critical section. Thus, there is an implicit timing dependency between the two processes, e.g., if one is much slower than the other, then the fast process will have to synchronize with the slow process on each cycle through the loop. Also, if either stops then the other can also only run through the critical section at most one more time
b. This algorithm does not solve the problem since it might allow both processes to be in the critical section at the same time. Suppose that the two processes "simultaneously" execute the while -test; they will both pass the test, set their respective flag and enter the critical section. The algorithm is not safe.
c. This algorithm attempts to resolve the problem described in part (b) by setting the flag before attempting to test the opposite flag. Now, if both processes set their respective flag variables "simultaneously," then the two processes are deadlocked.
2. (15 pnts) Problem 5 in the textbook on page 323.
Then, if all the buffers were to become empty at one time, the consumer would obtain the mutex semaphore and block on the full semaphore, while holding the mutex semaphore. This is a deadlock situation because the consumer holds all the empty buffers and requests a full one, but the producer cannot create a full buffer without first obtaining an empty buffer. The order of appearance of the P operations is significant.
3. (20 pnts) Problem 6 in the textbook on page 323.
Here is a solution:
4. (15 pnts) Problem 8 in the textbook on pages 323 and 324.
This is Peterson's software solution ( Information Processing Letters , vol. 12, pp. 115-116, 1981) to the critical section problem. The argument for its correctness is paraphrased from the original paper as follows:
First, only one process at a time should be allowed to enter its critical section (mutual exclusion).
For both processes to be in their critical sections, then they would have had to simultaneously set their own flag to TRUE, that is, flag[0] = flag[1] = TRUE. Thus, the two processes are simultaneously attempting to enter their critical section. Also, process 0 (process 1) only enters its critical section after it has set the turn variable to 1 (0) and if flag[1] (flag[0]) is FALSE or turn is 0 (1 in the case of process 1). But only one of the processes could have last set the value of turn, so it is either 0 or 1 at any instant. Suppose turn is 0; then process 1 will pass the while test and continue to evaluate the expression; process 0 will set turn to 1 (if it had not yet executed the statement, which means that process 1 will evaluate the expression FALSE on its next attempt), or it will evaluate the expression FALSE and will enter the critical section. Only one of the processes will be allowed to enter its critical section.
Second, once a process indicates a need to enter into its critical section, it cannot be postponed indefinitely.
A process can only be blocked from entering its critical section at the while loop. Thus, if process 0 is blocked, then it finds flag[1] TRUE and turn set to 1. Process 1 must be in its critical section, otherwise flag[1] would be FALSE. If process 1 is attempting to enter its critical section, then either turn is 0 or 1, thus one or the other is allowed to proceed. If it is 1, then process 1 will enter the critical section (or it is already in its critical section). In either case, process 1 will eventually exit its critical section and set flag[1] to FALSE. Process 0 will then fail the while test and enter the critical section. Notice that if process 1 exits the critical section and then attempts to reenter it it will block itself from competing with process 0 by setting turn to 0.
Third, after a process requests entry into its critical section, a bounded number of other processes may be allowed to enter before the original process enters the critical section. This follows by the same argument used for condition (2).
5. (20 pnts) Problem 10 in the textbook on pages 324 and 325.
6. (15 pnts) Problem 3 in the textbook on page 360.
COMMENTS
A small, point-like ball o f charg e −1.00µC and mass12.5g is hanging from a non-conducting, 30.0cm string that is attached to large vertical wall. If the string makes an angle of15.0 with. the wall, determine the surface char ge density on the w all, assuming that the charg e is uniformly.
MATH 3005 Homework Han-Bom Moon Homework 3 Solution Sections 3.1, 3.2. deadline: Sep. 30, 1:00 pm Do not abbreviate your answer. Write everything in full sentences. Write your answer neatly. If I couldn't understand it, you'll get 0 point. ... 3.Let S be a nonempty set and let P(S)be its power set, that is, the set of all subsets
PHYS 115A: Homework #3 Solution Set Charlotte Mason [email protected] Problem 1 Gri ths 2.3 Show that there is no acceptable solution to the time independent Schrdinger equa-tion (TISE) for a particle in an in nite square well with E= 0 or E<0. Following example 2.2 in the book we know that: V(x) = ˆ 0 if 0 x a 1 otherwise And the TISE ...
advertisement. Homework 3 Solution Set. Blake Chapter 8 Problems 1-10. 10 points (1 per problem) 1. Calculate the length (not specified in metric or English) of a practical half-wave dipole for a frequency of. 150 MHz. A practical half-wave dipole will be approximately 95% of a half-wavelength:
Homework 3 Solution Set Blake Chapter 8 Problems 1-10 10 points (1 per problem) 1. Calculate the length (not specified in metric or English) of a practical half-wave dipole for a frequency of 150 MHz. A practical half-wave dipole will be approximately 95% of a half-wavelength: m MHz m s f v 2.0 150 3 108 / = × λ= = m m L 0.95 2 2 (0.95) 2 =(0 ...
Free math problem solver answers your algebra homework questions with step-by-step explanations.
Solution: The following Matlab script finds the approximate solutions using the heuristic methods proposed, as well as the exact solution. % illum_sol: finds approximate and exact solutions of % the illumination problem. clear all; % load input data illum_data; % heuristic method 1: equal lamp powers.
Homework 3 - Problem Set (Numbered according to 9th edition) Problem 1: Section 3.1 #10 Problem 2: Section 3.1 #15 Problem 3: Section 3.1 #18 Problem 4: Section 3.3 #12 Problem 5: Section 3.3 #40 (read #34 first) ... General solution in complex form: y(t) = c 1e 3
Homework 3 Solutions hw03.zip; Solution Files. You can find the solutions in hw03.py. Required Questions Getting Started Videos ... The only thing that remains is to make sure that we have set up the playing board to make that possible. Since we move a disk to end rod, we run the risk of move_stack doing an improper move ...
Homework 3 Solution Set (continued) Next page
CVX101 Homework 3 solutions 4.1 Consider the optimization problem minimize f 0(x 1,x 2) subject to 2x 1 +x 2 ≥ 1 x 1 +3x 2 ≥ 1 x 1 ≥ 0, x ... Solution. (a) The feasible set of the relaxation includes the feasible set of the Boolean LP. It follows that the Boolean LP is infeasible if the relaxation is infeasible, and that
Yes! Textbook solutions are available on Quizlet Plus for $7.99/mo., while Chegg's homework help is advertised to start at $15.95/mo. Quizlet Plus helps you get better grades in less time with smart and efficient premium study modes, access to millions of textbook solutions, and an ad-free experience.
Homework 3. Solutions. Chap. 2 #2. Let Adenote the set of all algebraic numbers, let Bdenote the set of all equations of the form a 0z n+ a 1z n 1 + a n 1z+ a n= 0; (1) for all n= 1;2;:::, where each a j is integer, and a 0 6= 0. If 2B, denote by R the set of all real roots of equation. Since has at most ndistinct roots, R is a nite set for ...
QuickMath will automatically answer the most common problems in algebra, equations and calculus faced by high-school and college students. The algebra section allows you to expand, factor or simplify virtually any expression you choose. It also has commands for splitting fractions into partial fractions, combining several fractions into one and ...
Homework 3: Solutions ECS 20 (Fall 2017) Patrice Koehl [email protected] September 20, 2017 ... n be a set of n real numbers. Prove that at least ... Since 4k3 + 3 is an integer, n3 + 7 can be written in the form 2k0 + 1, where k0 is an integer; therefore, ...
Homework 3 Solutions Sec. 1.7, p.71: 6 -4 -3 0 0 0 -1 4 0 1 0 3 0 5 4 6 0 Interchanging R1 & R3 : 1 0 3 0 0 -1 4 0
Homework 3 solution 1. [page 31, #39 ] Prove Gallai's theorem that the edge set of any graph G can be written as a disjoint union E(G) = C[Dwith C 2C(G) and D2C(G). Proof: Let Gbe an arbitrary graph. Suppose for jGj<nthere is a partition of Gsuch that G[V 1] and G[V 2] both have even degree and D= fab2E(G)ja2V 1;b2V 2g. Consider Gwith jGj= n.
Math 8: Homework #3 Solution 1.6 - 1 b,e b) Let m = 1 and n = −1. Then 15(1)+(−1)12 = 3. e) Suppose there are integers m, n, and t such that 15m + 16n = t. Let ... The smallest possible set is the empty set, whose power set is {∅} (i.e. a one element set, not the empty set). So this is not possible.
Homework 3 - Solutions Math 220, Instructor: Alena Erchenko \(*)" means that the problem is optional. ... 1 3 5 3 8 2 2 5 1 3 5, then the solution set of Bx = 0 is (a) a single point; (b) a line in R3; (c) a plane in R3; (d) the set of all points in R3: Explain your answer. Solution. Bring the corresponding augmented matrix into row echelon form.
Homework 3 solutions, Fall 2010 Joe Neeman 4. An MA(1) model would have a correlation function that was zero for lags of 2 or more. Similarly, an MA(2) model would have a correlation function that was zero for lags of 3 or more. Neither of these correponds to the sample ACF shown in Figure 1. An AR(1) model, on the other hand,
Video answers for all textbook questions of chapter 3, Homework 3, Automata and Computability undergraduate texts in computer science by Numerade
Read Until Sec 3.2 quiz 3 and its solution; Homework 3: all short answer questions from Section 2.8 to Section 2.12 in the course notes due: 4pm on 7.3. Problem set 6 with solutions Quiz 3 and its solution . 7.1 CDF and Continuous-type r.v lec 15-17 Read Until Sec 3.2; 7.2 PDF, Uniform r.v. lec 18-20 Read Until Sec 3.4; 7.3, Exponential r.v lec ...
Homework 3 - Process Synchronization - Solutions . ... they will both pass the test, set their respective flag and enter the critical section. The algorithm is not safe. c. ... This is Peterson's software solution (Information Processing Letters, vol. 12, pp. 115-116, 1981) to the critical section problem. The argument for its correctness is ...