Quiz 2 Flashcards
After a “fork()” system call, what does the OS return to the parent process?
Process ID (PID) of the new child process
Why does a parent process perform a “wait()” system call?
So it knows when the child process terminates
What are the names of the six items in the PCB?
PID, process state, program counter (PC), CPU registers, memory management information, scheduling and account information
What are two main mechanisms for IPC?
Shared memory and message passing
What are the names of different states in the process state diagram?
new, ready, running, waiting, terminated, suspended
In what situation would the “ready queue” become empty?
When there are no processes in the system that are ready to execute
What is the task of the medium-term scheduler?
Process swapping
How many processes can communicate with a process that has shared memory segment?
No fixed limit
The ____ of a process contains temporary data such as function parameters, return addresses, and local variables
stack
A process control stack ___
A) Includes information on the process’s state
B) Stores the address of the next instruction to be processed by a different process
C) Determines which process is to be executed next
D) Is an example of a process queue
A
The list of processes waiting for a particular I/O device
Device queue (or I/O queue)
The _____ refers to the number of processes in memory
Degree of multiprogramming
When a child process is created, which of the following is a possibility in terms of the execution or address space of the child process?
A) The child process runs concurrently with the parent
B) The child process has a new program loaded into it
C) The child is a duplicate of the parent
D) All of the above
D
A ______ saves the state of the currently running process and restores the state of the next process to run
Context switch
A process may transition to the ready state by which of the following actions?
A) Completion of an I/O event
B) Awaiting its turn on the CPU
C) Newly-admitted process
D) All of the above
D
In a(n) ____ temporary queue, the sender must always block until the recipient receives the message
Zero capacity
A blocking send() and blocking receive()
Synchronized message
Which of the following is true in a Mach operating system?
A) All messages have the same priority
B) Multiple messages from the same sender are guaranteed an absolute ordering
C) The sending thread must return immediately if a mailbox is full
D) It is not designed for distributed systems
B
When communicating with sockets, a client process initiates a request for a connection and is assigned a port by the host computer. Which of the following would be a valid port assignment for the host computer?
A) 21
B) 23
C) 80
D) 1625
D
A()n ______ allows several unrelated processes to use the pipe for communication
Named pipe
Which of the following statements is true?
A) Shared memory is typically faster than message passing
B) Message passing is typically faster than shared memory
C) Message passing is most useful for exchanging large amounts of data
D) Shared memory is far more common in operating systems than message passing
A
Child processes inherit UNIX ordinary pipes from their parent process because:
A) The pipe is part of the code and children inherit code from their parents
B) A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents
C) The STARTUPINFO structure establishes this sharing
D) All IPC facilities are shared between the parent and child processes
B
Which of the following statements is true?
A) Named pipes do not allow bi-directional communication
B) Only the parent and child processes can use named pipes for communication
C) Reading and writing to ordinary pipes on both UNIX and Windows systems can be performed like ordinary file I/O
D) Named pipes can only be used by communicating processes on the same machine
C
Which of the following is not a process type in the Chrome browser?
A) Plug-in
B) Renderer
C) Sandbox
D) Browser
C
The _______ application is the application appearing on the display screen of a mobile device
Foreground (front-end)
A process that has terminated, but whose parent has not yet called wait(), is known as a _____ process
zombie
The _____ process is assigned as the parent to orphan processes
init
Name and describe the different states that a process can exist in at any given time
New: Process is created but not yet started executing
Ready: Process is waiting in the ready queue for the scheduler to allocate the CPU
Running: The process is currently being executed by the CPU
Waiting: The process is waiting for some event to occur
Terminated: The process has completed execution or has been terminated
Explain the main differences between a short-term and long-term scheduler
Short term decides which process gets the CPU ready, runs frequently, focuses on CPU scheduling and ensuring high CPU utilization, focused on responsiveness and fairness, operates on the ready queue/selects processes to run, round-robin algorithm
Long term decides which processes to admit to the system, runs infrequently, focused on resource management, controls the number of processes in memory, loads balancing, resource allocation and efficient process management, operates on the job queue, admission control algorithm
Explain the difference between an I/O-bound process and a CPU-bound process
I/O-bound is limited to I/O operations, low CPU usage, frequent operations, ex: web browsers
CPU-bound is limited by CPU processing power (focused on computations), high CPU usage, minimal or no I/O operations, ex: video rendering
Explain the concept of a context switch
The process of saving the state of a currently running process and restoring the state of another process so that it can be executed. This allows an operating system to multitask and manage the execution of multiple processes by switching between them
Explain the fundamental differences between the UNIX fork() and Windows CreateProcess() functions
fork() had no parameters, CreateProcess() has 10, fork() children inherits a copy of the address space of its parent, with CreateProcess(), specifying the address space of the child is required
Name the three types of sockets used in Java and the classes that implement them
Stream Sockets (TCP sockets), Class: Socket
Datagram Sockets (UDP sockets), Class: DatagramSocket
Multicast Sockets, Class: MulticastSocket
What is a loopback and when is it used?
A special network interface that allows network communication to be sent from a program to itself. Used for testing and development, troubleshooting, local communication and security
Explain the purpose of external data representation (XDR)
Platform independence, data serialization, interoperability, consistency across systems
Explain the term marshalling
The process of converting an object, data structure or variable into a format that can be easily transmitted over a network, stored, or passed between different parts of a program
Explain the terms “at most once” and “exactly one” and indicate how they relate to remote procedure calls
Guarantees the RPC is executed no more than once vs exactly once
Describe two approaches to the binding of client and server ports during RPC calls
Client is programmed with the servers IP addr and port number and directly send requests. Server listens for incoming RPC requests on a specific port
Ordinarily the exec() system call follows the fork(). Explain what would happen if a programmer were to inadvertently place the call to exec() before the call to fork()
A child wouldn’t be created
Explain why Google Chrome uses multiple processes
Each website opens up in a separate tab and is represented with a separate renderer process. If that webpage were to crash, only the process representing that tab would be affected, all other sites would be unaffected
Describe how UNIX and Linux manage orphan processes
Automatically adopted by the init process, which cleans up zombie processes
T/F All processes in UNIX first translate to a zombie process upon termination
False
T/F The difference between a program and a process is that a program is an active entity while a process is a passive entity
False
T/F The exec() system call creates a new process
False
T/F All access to POSIX shared memory requires a system call
True
T/F Local Procedure Calls in Windows XP are similar to Remote Procedure Calls
False
T/F For a single-processor system, there will never be more than one process in the Running state
True
T/F Shared memory is a more appropriate IPC mechanism than message passing for distributed systems
False
T/F Ordinary pipes in UNIX require a parent-child relationship between the communicating processes
True
T/F Ordinary pipes in Windows require a parent-child relationship between the communicating processes
False
T/F Using a section object to pass messages over a connection port avoids data copying
True
T/F A socket is identified by an IP address concatenated with a port number
True
T/F Sockets are considered a high-level communications scheme
True
T/F The Mach operating system treats system calls with message passing
True
T/F Named pipes continue to exist in the system after the creating process has terminated
True
How does a parent process create a child process that executes a different program?
By calling fork() and then exec()
Briefly explain the functionality of the server-stub
Handles and interprets RPC requests and calls appropriate server-side functions or procedures
Who is responsible for synchronization or processes in the shared memory IPC?
App developer or the operating system