CIS332 (Fadll 1998)
Principles of Operating Systems;
Professor Franz J. Kurfess
Home page:http://www.cis.njit.edu/franzE-mail:franz@cis.njit.edu
Faculty Assistant: Ravi Gangavarapu; E-mail:cis332fk@cis.njit.edu
(All questions regarding homework should be sent to this address)
Homework |
Task |
Deadline |
Points |
Student Name: |
1 |
Computer and Operating System Structures |
Thursday, Sep. 11, 1998 |
|
The following questions are intended to asses your background needed for this course.
1 a). What is the final value of next-count when the following pseudo code is
executed with an initial value of x-count = 0 ?. Convert the pseudo code into C
language code. |
next-count := 0; |
loop until x-count = 2 |
if x-count < 1 then begin |
next-count := next-count + 1; |
x-count := x-count + 1; |
end; |
end loop; |
b). Explain the execution of the following two C codes. Assume that they are executed
simultaneously and share a common variable turn with an initial value of 0. |
(a). |
|
|
(b). |
while (TRUE) { |
|
|
while (TRUE) { |
while (turn != 0) |
|
|
while (turn != 1) |
critical_section(); |
|
|
critical_section(); |
turn =1; |
|
|
turn =0; |
noncri_section(); |
|
|
noncri_section(); |
} |
|
|
} |
2. What is the main function of the main memory (RAM) in a computer system?.
3. List your experiences with the following (List hardware, software etc., you have used).
a). Hardware
b). Operating Systems
c). Application Programming Software