CSCI 1733

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What is the degree of multiprogramming for a single-processor system? A) 0 B) 1 C) 2 D) 3

B) 1

Which of the following contains memory allocated by malloc()? A) text section B) data section C) heap section D) stack section

C) heap section

T/F Background processes are not apparent to users.

TRUE

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

TRUE

Describe the Process state

When a process executes, it passes through different states. These stages may differ in different operating systems, and the names of these states are also not standardized.

What is a loopback and when is it used?

A loopback is a special IP address: 127.0.0.1. When a computerrefers to IP address 127.0.0.1, it is referring to itself. When usingsockets for client/server communication, this mechanism allows a clientand server on the same host to communicate using the TCP/IP protocol.

Describe the difference between Process VS Thread

A process is an active program i.e. a program that is under execution. It is more than the program code as it includes the program counter, process stack, registers, program code etc. Compared to this, the program code is only the text section. A thread is a lightweight process that can be managed independently by a scheduler. It improves the application performance using parallelism. A thread shares information like data segment, code segment, files etc. with its peer threads while it contains its own registers, stack, counter etc.

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

The primary distinction between the two schedulers lies in the frequency of execution. The short-term scheduler is designed to frequently select a new process for the CPU, at least once every 100 milliseconds. Because of the short time between executions, the short-term scheduler must be fast. The long-term scheduler executes much less frequently; minutes may separate the creation of one new process and the next. The long-term scheduler controls the degree of multiprogramming. Because of the longer interval between executions, the long-term scheduler can afford to take more time to decide which process should be selected for execution.

Describe how UNIX and Linux manage orphan processes.

UNIX and Linux assigne the init process as the new parent process to orphan processes. The init process periodically invokes wait(), thereby allowing the exit status of any orphaned process.

Explain the concept of a context switch.

Whenever the CPU starts executing a new process, the old process's state must be preserved. The context of a process is represented by its process control block. Switching the CPU to another process requires performing a state save of the current process and a state restore of a different process. This task is known as a context switch. When a context switch occurs, the kernel saves the context of the old process in its PCB and loads the saves context of the new process scheduled to run.

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) All messages have the same priority.

Which of the following is true? A) An I/O-bound process is one that spends more of its time doing I/O than it spends doing computations B) An I/O-bound process is one that spends more of its time doing computations than it spends doing I/O C) Both A and B D) None of the above

A) An I/O-bound process is one that spends more of its time doing I/O than it spends doing computations

Which of the following selects from among the processes that are in the ready queue to execute and allocate the CPU to one of them? A) CPU scheduler B) context switch C) swapping D) job scheduler

A) CPU scheduler

Assume the shared buffer is implemented as a circular array with two logical pointers: in and out. The variable in points to the next free position in the buffer; out points to the first full position in the buffer. Which of the following is true? A) The buffer is empty when in == out; the buffer is full when ((in + 1) % BUFFER SIZE) == out; B) The buffer is full when in == out; the buffer is empty when ((in + 1) % BUFFER SIZE) == out; C) All the elements of the buffer can be used; D) Both A and C

A) The buffer is empty when in == out; the buffer is full when ((in + 1) % BUFFER SIZE) == out;

What is done by command "pS -el" on Unix and Linux systems? A) list complete information for all processes currently active in the system B) list complete information for all processes currently running in background C) list complete information for all files currently open in the system D) list complete information for all folders currently open in the system

A) list complete information for all processes currently active in the system

Which of the following process state will be switched from "running" state when an interrupt occurs? A) ready B) terminated C) waiting D) new

A) ready

Which of the following structures defines the process control block for Linux system? A) task_struct B) files_struct C) mm_struct D) schedu_entity

A) task_struct

Which of the following contains the executable code? A) text section B) data section C) heap section D) stack section

A) text section

Which of the following data structure is used to manage the processes in Linux? A) tree B) linked list C) hash map D) stack

A) tree

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) A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents.

If process P0 is switched to process P1, state for P0 will be saved into ____, and state from ___ will be reloaded? A) PCB0, PCB0 B) PCB0, PCB1 C) PCB1, PCB0 D) PCB1, PCB1

B) PCB0, PCB1

Which of the following contains global data? A) text section B) data section C) heap section D) stack section

B) data section

Which of the following system calls is used to have a new program loaded into the new process's memory space? A) fork() B) exec() C) wait() D) exit()

B) exec()

Which of the following IPC mechanism is easier to implement in a distributed system? A) shared memory B) message passing C) socket communication D) ordinary pipe

B) message passing

Explain the terms "at most once" and "exactly once" and indicate how they relate to remote procedure calls.

Because a remote procedure call can fail in any number of ways, it is important to be able to handle such errors in the messaging system. The term "at most once" refers to ensuring that the server processes a particular message sent by the client only once and not multiple times. This is implemented by merely checking the timestamp of the message. The term "exactly once" refers to making sure that the message is executed on the server once and only once so that there is a guarantee that the server received and processed the message.

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().

Because exec() overwrites the process, we would never reach the call to fork() and hence, no new processes would be created. Rather, the program specified in the parameter to exec() would be run instead.

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

C) Sandbox

Which of the following system calls is used to let the parent process create a child process? A) abort(); B) wait(); C) fork(); D) exec().

C) fork();

Which of the following contains dynamically allocated data during program run time? A) text section B) data section C) heap section D) stack section

C) heap section

The list of processes waiting to execute on a CPU is called a(n) ____. A) standby queue B) device queue C) ready queue D) interrupt queue

C) ready queue

Which of the following process state will be switched from "running" state when an I/O event occurs? A) ready B) terminated C) waiting D) new

C) waiting

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

Connection-oriented (TCP) sockets are implemented with the Socketclass. Connectionless (UDP) sockets use the DatagramSocket class.Finally, the MulticastSocket class is a subclass of the DatagramSocketclass. A multicast socket allows data to be sent to multiple recipients.

Which of the following cases could force a process removed from the CPU? A) I/O request B) fork a child C) interrupt or time slice expired D) all of the above

D) all of the above

The ________ application is the application appearing on the display screen of a mobile device. A) main B) background C) display D) foreground

D) foreground

Which of the following process state will be switched from "ready" state? A) ready B) terminated C) waiting D) running

D) running

Which of the following memory space dynamically grows from high memory to low memory? A) text section B) data section C) heap section D) stack section

D) stack section

Explain the purpose of external data representation (XDR).

Data can be represented differently on different machinearchitectures (e.g., little-endian vs. big-endian). XDR represents dataindependently of machine architecture. XDR is used when transmitting databetween different machines using an RPC.

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

Each function is used to create a child process. However, fork() hasno parameters; CreateProcess() has ten. Furthermore, whereas the childprocess created with fork() inherits a copy of the address space of itsparent, the CreateProcess() function requires specifying the addressspace of the child process.

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 the tab would be affected, all other sites (represented as separate tabs/processes) would be unaffected.

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

FALSE

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

FALSE

T/F The communication with named pipes requires parent-child relationship.

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 Independent process can affect or be affected by the execution of another process

FALSE

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

First, the binding information may be predetermined, in the form offixed port addresses. At compile time, an RPC call has a fixed portnumber associated with it. Second, binding can be done dynamically by arendezvous mechanism. Typically, an operating system provides arendezvous daemon on a fixed RPC port. A client then sends a messagecontaining the name of the RPC to the rendezvous daemon requesting theport address of the RPC it needs to execute. The port number isreturned, and the RPC calls can be sent to that port until the processterminates (or the server crashes).

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

TRUE

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

TRUE

T/F Execution of program started via GUI mouse clicks, command line entry of its name, etc

TRUE

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

TRUE

T/F Ordinary pipes are unidirectional, allowing only one-way communication.

TRUE

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

TRUE

T/F Program is passive entity stored on disk (executable file), process is active

TRUE

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

TRUE

T/F The iOS mobile operating system only supports a limited form of multitasking.

TRUE

T/F The program code is called text section

TRUE

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

TRUE

T/F init is the very first process for a typical Linux system.

TRUE

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

states of a process are: new, running, waiting, ready, and terminated. The process is created while in the new state. In the running or waiting state, the process is executing or waiting for an event to occur, respectively. The ready state occurs when the process is ready and waiting to be assigned to a processor and should not be confused with the waiting state mentioned earlier. After the process is finished executing its code, it enters the termination state.

Explain the term marshalling.

Marshalling involves the packaging of parameters into a form that can be transmitted over the network. When the client invokes a remote procedure, the RPC system calls the appropriate stub, passing it the parameters provided to the remote procedure. This stub locates the port on the server and marshals the parameters. If necessary, return values are passed back to the client using the same technique.

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

The differences between the two types of processes stem from thenumber of I/O requests that the process generates. An I/O-bound processspends more of its time seeking I/O operations than doing computationalwork. The CPU-bound process infrequently requests I/O operations andspends more of its time performing computational work.


Kaugnay na mga set ng pag-aaral

Series 6: Regulations (Securities Act of 1933)

View Set

Culinary Essentials; Fruits and Vegetables

View Set

Federal Tax Considerations for Life Insurance and Annuities - Practice Questions

View Set

CLA 10 Unit 13 Trojan War: Beginning of Strife

View Set

Test bank: Ch.17 Gene Expression Bio 1

View Set