Quiz 2 Flashcards

1
Q

After a “fork()” system call, what does the OS return to the parent process?

A

Process ID (PID) of the new child process

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why does a parent process perform a “wait()” system call?

A

So it knows when the child process terminates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the names of the six items in the PCB?

A

PID, process state, program counter (PC), CPU registers, memory management information, scheduling and account information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are two main mechanisms for IPC?

A

Shared memory and message passing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the names of different states in the process state diagram?

A

new, ready, running, waiting, terminated, suspended

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In what situation would the “ready queue” become empty?

A

When there are no processes in the system that are ready to execute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the task of the medium-term scheduler?

A

Process swapping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How many processes can communicate with a process that has shared memory segment?

A

No fixed limit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The ____ of a process contains temporary data such as function parameters, return addresses, and local variables

A

stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The list of processes waiting for a particular I/O device

A

Device queue (or I/O queue)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The _____ refers to the number of processes in memory

A

Degree of multiprogramming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A ______ saves the state of the currently running process and restores the state of the next process to run

A

Context switch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In a(n) ____ temporary queue, the sender must always block until the recipient receives the message

A

Zero capacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

A blocking send() and blocking receive()

A

Synchronized message

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

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

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

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

A

D

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

A()n ______ allows several unrelated processes to use the pipe for communication

A

Named pipe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

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

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

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

A

B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

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

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Which of the following is not a process type in the Chrome browser?
A) Plug-in
B) Renderer
C) Sandbox
D) Browser

25
Q

The _______ application is the application appearing on the display screen of a mobile device

A

Foreground (front-end)

26
Q

A process that has terminated, but whose parent has not yet called wait(), is known as a _____ process

27
Q

The _____ process is assigned as the parent to orphan processes

28
Q

Name and describe the different states that a process can exist in at any given time

A

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

29
Q

Explain the main differences between a short-term and long-term scheduler

A

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

30
Q

Explain the difference between an I/O-bound process and a CPU-bound process

A

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

31
Q

Explain the concept of a context switch

A

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

32
Q

Explain the fundamental differences between the UNIX fork() and Windows CreateProcess() functions

A

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

33
Q

Name the three types of sockets used in Java and the classes that implement them

A

Stream Sockets (TCP sockets), Class: Socket
Datagram Sockets (UDP sockets), Class: DatagramSocket
Multicast Sockets, Class: MulticastSocket

34
Q

What is a loopback and when is it used?

A

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

35
Q

Explain the purpose of external data representation (XDR)

A

Platform independence, data serialization, interoperability, consistency across systems

36
Q

Explain the term marshalling

A

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

37
Q

Explain the terms “at most once” and “exactly one” and indicate how they relate to remote procedure calls

A

Guarantees the RPC is executed no more than once vs exactly once

38
Q

Describe two approaches to the binding of client and server ports during RPC calls

A

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

39
Q

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

A child wouldn’t be created

40
Q

Explain why Google Chrome uses multiple processes

A

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

41
Q

Describe how UNIX and Linux manage orphan processes

A

Automatically adopted by the init process, which cleans up zombie processes

42
Q

T/F All processes in UNIX first translate to a zombie process upon termination

43
Q

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

44
Q

T/F The exec() system call creates a new process

45
Q

T/F All access to POSIX shared memory requires a system call

46
Q

T/F Local Procedure Calls in Windows XP are similar to Remote Procedure Calls

47
Q

T/F For a single-processor system, there will never be more than one process in the Running state

48
Q

T/F Shared memory is a more appropriate IPC mechanism than message passing for distributed systems

49
Q

T/F Ordinary pipes in UNIX require a parent-child relationship between the communicating processes

50
Q

T/F Ordinary pipes in Windows require a parent-child relationship between the communicating processes

51
Q

T/F Using a section object to pass messages over a connection port avoids data copying

52
Q

T/F A socket is identified by an IP address concatenated with a port number

53
Q

T/F Sockets are considered a high-level communications scheme

54
Q

T/F The Mach operating system treats system calls with message passing

55
Q

T/F Named pipes continue to exist in the system after the creating process has terminated

56
Q

How does a parent process create a child process that executes a different program?

A

By calling fork() and then exec()

57
Q

Briefly explain the functionality of the server-stub

A

Handles and interprets RPC requests and calls appropriate server-side functions or procedures

58
Q

Who is responsible for synchronization or processes in the shared memory IPC?

A

App developer or the operating system