CS439: Principles of Computer Systems
Discussion Section 1 Problem Set
Due in Section on Friday, January 16, 2024
The problem set must be completed before section and brought to section. To
ensure that your problem set is turned in correctly and that you receive credit
for discussion section, you must follow these guidelines exactly.
- Include the following header at the top of your file:
Discussion Section Problem Set #:
Student Name:
EID:
If you could meet anyone in the world, who would you want to meet?:
Partner Name:
EID:
If you could meet anyone in the world, who would you want to meet?:
- You may either type your answers or write them by hand, but you must have a
copy with you in discussion section.
-
In discussion section, your TA will check that you worked with your partner,
you made a good effort on the
problem set, you are participating in the discussions in section, and you are
ready and able to answer when called upon. If all of those are true, you will
receive credit for discussion section that day. Note that a "good effort" on
the problem set includes that all answers are in words unique to you and your
partner and not
copied from anywhere else, including the slide deck.
-
What is concurrency? List some examples of concurrency appearing
in the history of operating systems.
-
Phase 2 of the history of operating systems brought about interactive timesharing
which allowed multiple users to use the same system at the same time.
-
What key hardware feature enabled the development of interactive timesharing?
-
What new OS considerations were required to support multiple users?
-
What are "privileged instructions"? Name three situations
in which privileged instructions are required.
-
Given the following piece of code:
main(int argc, char** argv)
{
forkThem(5);
}
void forkThem(int n)
{
if(n>0)
{
fork();
forkThem(n-1);
}
}
How many processes are created if the above piece of code is run?
-
Given the following piece of code:
main(int argc, char**argv)
{
int child=fork();
int c=2;
if(child==0)
{
c+=2;
}
else
{
child=fork();
c+=4;
if(child==0)
c+=2;
}
}
How many different copies of the variable c are there? What
are their values?
Defend your answer.
|