Midterm Flashcards
Name a general trend in going up or down the memory hierarchy?
speed is slower moving down the hierarchy
size is larger moving down the hierarchy
cost is less moving down the hierarchy
what is the relationship between the operating system and the kernel?
a kernel is a subset of the operating system
do system calls require kernel mode? why?
No, because system calls are like the communication between the operating system and the kernel mode.
Describe the relationship between a library procedure and a system-call.
Library procedure initiate a system call to access a memory address
Is a program a process?
only when it is running - process is a runnable program
How many processes can be run at a time on a single-processor?
1
Which of the following does each thread have a separate copy?
address space global variables * program counter * registers * stack
Does an operating system have both user and kernel threads?
No, user will use in the application level and kernel will use operating system
Why do operating systems have user or kernel modes of execution?
to protect the operating system
What is a microkernel?
a small kernel
What is motivating factor behind the design decisions for a microkernel?
bugs
What is the UNIX equivalent to the CreateProcess( ) system call?
Fork( )
what will be displayed after executing the following code?
fork( );
fork( );
printf(“All done!\n”);
Prints all done four times
Name a service that the operating system provides.
Process scheduling
Resource usage
Accessing I/O devices
File system accesses/management
What is the stack of a thread?
parameters
local variables
The process table contains what kind of information?
process name and state
priority
registers
semaphores
What are the major steps of a context switch?
Stopping one process and starting a new one
Name 2 or more events that would cause a process to transition to the ready state?
one event is when the process has scheduled an interrupt. Another event is when one process has finished executing and the next process is ready to start executing
What does the fork( ) system call do?
Its a process that creates a copy of itself.
What does the execve( ) system call do?
Execve( ) is used to overlay a process image that has been created by a call from the fork( ) function.
What does pthread_join( ) do?
pthread_join( ) waits for a specific thread to exit
Name at least one benefit of using multithreaded programming?
You can run two processes at the same time instead of one at a time but the CPU will think it is only one process.
What are the labels for the states that a process may be in?
A. creation B. termination C. ready D. running E. blocked
What are the labels for the transitions between process states?
A. fork or create process B. Scheduler C. Exit D. Scheduler E. Event handling