CSCE4600 Exam 1 Flashcards
The OS is responsible for
- Unify view of memory
- Transfer Data between CPU and other devices
- Keep track of file locations
- Provide HW / Platform Independence
- Mediate Resource Usage
What are the 3 views of OS
Abstraction
Virtualization
Resource Management
I/O primitives are…
system calls, executed by the kernal
Name the 6 UNIX primitives
- create()
- open()
- close()
- read()
- write()
- ioctl()
If pathname does not start with / it is assumed…
to start in the current directory
if pathname starts with ./
current directory
if pathname starts with ../
refers to the parent directory
In Kernel mode, the executing code has..
complete and unrestricted access to the underlying hardware
Generally reserved for the lowest-level, most trusted functions
Kernel mode
In User mode, the executing code has…
no ability to directly access hardware or reference memory
Advantage for user mode,
crashes in user mode are always recoverable
Disadvantage for Kernel mode,
crashes are catastrophic
Why is unbuffered I/O suffer a performance loss?
you read and/or write one byte at a time
Buffered I/O is a net win when…
performing a large humber of small writes
A program whose execution has started and not yet terminated
A process
If all executions allowed under precedence relation result in the same values, then system is
Determinant
for (Pi,Pj), Pi must…
complete before the start of Pj
Mutually non-interfering systems ARE/AREN’T determinant
ARE
Name the 7 parts of a process
1) Process State
2) Program counter
3) CPU registers
4) CPU scheduling
5) Memory management
6) Accounting information
7) I/O status
Set of all processes in the system
Job queue
set of all processes residing in main memory, ready and waiting
Ready queue
set of processes waiting for an I/O device
device queue
selects which processes should be brought into the ready queue
Long-term scheduler
selects which process should be executed next and allocates CPU
Short-term scheduler
spends more time doing I/O than computations, many short CPU bursts
I/O bound process
spends more time doing computations, few very long CPU bursts
CPU-bound process
Any code segment that accesses a shared data area is referred to as…
Critical Section
solution to the Critical Section problem is to..
allow at most one process to be active, Mutual Exclusion
A process that is currently not executing in its critical section must not prevent other processes to enter the critical section
Progress
A process must not repeatedly enter its critical section, thereby preventing other processes to enter the critical section
Starvation
two processes that are about to enter their critical section must not block each other indefinitely
Deadlock
two processes about to enter their critical section must not repeatedly yield to each other indefinitely
Livelock
Name a requirement for Critical Section problem
A thread which dies in its critical non-critical section will not affect the others’ ability to continue.
Changes a process from ready state to running state
Short-Term scheduler
Another name for Short-term scheduler
CPU scheduler
Removes the process from the memory
Medium-term scheduler
In charge of handling the swapped out processes
Medium-term scheduler
Name the three types of queues
Job queue
Ready queue
Device queues
An analogy for synchronous communication
A phone call
An analogy for asynchronous communication
A letter
No blocking, so resources could be freed
Asynchronous Communication
Requestor blocks, held resources are “tied up”.
Synchronous communication
Response times are unpredictable
Asynchronous communication
Outcome is known immediately
Synchronous communication
If the system is
determinate for all interpretations…
then all processes are mutually non-interferring
Every read and write will cause a context switch
Unbuffered I/O
Collects as many bytes as you can before writing to file
Explicit buffered I/O
Explicit buffered I/O uses…
UNIX I/O primitives
Implicit buffered I/O uses…
Stream facility library
allocates memory in the process table and creates a copy of the current process.
fork()
used to terminate a process
exit()
temporarily suspends parent process until one of the child processes has terminated
wait()
used to execute the corresponding process
exec()
A newly created child process returns
0
the status in the wait() function is…
a pointer to an integer to which the child’s status information is assigned
how could read() fail
could fail if you try and access something you don’t have permissions to access
how could write() fail
could fail if you don’t have adequate memory allocated to write to
how could fork() fail
could fail if system has reached limit of total processes
how could close() fail
can fail if file descriptor is invalid
how could waitpid() fail
could fail if the called child process does not exist