Skip to document

340final old online 1 - Practice questions for final

Practice questions for final
Course

Operating Systems Principles (CSCI 340)

16 Documents
Students shared 16 documents in this course
Academic year: 2021/2022
Uploaded by:
Anonymous Student
This document has been uploaded by a student, just like you, who decided to remain anonymous.
Queens College CUNY

Comments

Please sign in or register to post comments.

Preview text

Welcome

Copy and paste the question and then the answer, if you do it separately

It should format a bit better

To vote on an answer, simply add + next to the answer you like

A. Bad answer +

B. good answer ++++

To look for questions, ctrl + f

If we have backtracking, go through the questions and then circle back through them as we get

ideas

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Questions Answer

A newly admitted process may only reach the running state from which state?

Ready+

What are the names of the processes associated with the bounded 1

4

buffer problem?

1. Producer

2. Peterson

3. Philospher

4. Consumer

Portability, the ability of user programs to run across different

operating systems, is hindered by what items:

1 CPUs have varying instruction sets. .

2 System calls vary among operating . systems.

3 Each operating system can have its . own binary formats for object and executable files.

4 Virtual machine availability for . programming languages across operating systems.

1,2,3,

Based on the mid term

answer is 1, 3

The portion of code in a program in which we access shared data Remainder section

is known as the: +++++

Someone please double

1. check

Entry section (Google approves)

2.

Remainder section

3.

Exit section

4.

Critical section

What is the purpose of the mutex semaphore in the

implementation of the bounded buffer

producer-consumer problem using semaphores?

1. It ensures mutual exclusion.

What are the operations associated with semaphores?

  1. release

  2. signal

  3. acquire

  4. wait

2

4

Halted ready and waiting states are used for what purposes? To terminate a process

and to balance system

load

In a dynamically linked library which item is true 1. system language libraries are treated like any other object module

  1. loading is postponed until execution time

  2. more disk space is used than in a statically linked library

  3. a stub is included in the executable for each library routine reference

4

Features of the multilevel feedback queue include the following

items:

1 Multiple scheduling algorithms .

·

2 Process upgrade and demotion strategies .

3 Adaptive process scheduling through learning about . each process' behavior

4 Dynamic process priorities .

Scheduling may occur with respect to which items? 1, 2, 3, 4

1.

Cache

2.

Kernel threads

3.

Hardware threads

4.

User threads

In what multithread design pattern does a parent thread generate a new child thread to service eachapplication request received by the parent, and in which the child thread immediately terminates after processing the request?

Master thread - child

thread

Deadlock in the Dining-Philosophers problem can occur in which

situations?

1 Each philosopher obtains their left

. utensil.

2 Two philosophers obtain both of their

. left and right utensils.

3 Each philosopher obtains their right

.

utensil.

4 One philosopher obtains both left and

. right utensils.

1 3+ i think++

Which item(s) are services provided by an operating system? All 5++

The number of processes in memory is referred to as the degree of multiprogramming+

The pthread_attr_t structure for threads is analogous to which

structure for Linux processes?

  1. User credentials

  2. Process pid

  3. Task control block

3?

This should be Task

control block !!

4. Open file descriptors table

Choose all items that are not weaknesses of Deadlock, indefinite postponement,

Preliminary Peterson's Algorithm 1. both threads may be in their critical...

I Both threads must strictly alternate . with each other in entering their critical sections.

Everything but both threads may be in

their critical sections at the same time

I Deadlock I .

I Both threads may be in their critical I sections at the same time. I .

I Indefinite Postponement V .

Choose the item that is not a technique for

passing parameters from a user application to a

system call.

  1. Stack

  2. Registers

  3. Cache

  4. Special block in memory

3

The round robin scheduling algorithm is utilized within the priority scheduling algorithm for which reason? choices?

To have a tie-breaker rule for handling multiple processes with the same priority+

What is the purpose of the mutex semaphore in

the implementation of the bounded buffer

producer-consumer problem using semaphores?

  1. It indicates the number of empty slots in buffer.

  2. It ensures mutual exclusion.

  3. It indicates the number of occupied slots buffer.

  4. It controls access to the remainder sectio

It ensures mutual exclusion +

User thread scheduling on to kernel threads within

a multithreaded process does not utilize

lightweight processes in which model below?

  1. Solaris Green Threads

  2. Many-to-One

  3. Many-to-Many

  4. One-to-One

A page fault occurs when:

1. a process tries to access a page whose

contents are NOT in physical memory

2. a process tries to access a page whose

page table entry IS in cache

3. a process tries to access a page whose

page table entry is NOT in cache

4. a process tries to access a page whose

contents ARE in physical memory

3- // I think I was wrong here

So its 1?

I think it’s 1+++

Is it main memory tho?

//Cache is also memory is it not, I tink

so. It’s CPU memory

From google:

A page fault occurs when an access to

a page that has not been brought into

main memory takes place. The

operating system verifies the memory

access, aborting the program if it is

invalid.

What are the three strategies for selecting a free

  1. Best fit

unit

  1. page table

  2. program counter

  3. cache

Internal fragmentation occurs in which memory

management scheme?

1 Paging .

2 Swapping .

3 Variable partition contiguous . memory allocation

4 Hashed page tables .

1. Paging

A page fault occurs when:

  1. a process tries to access a page whose c memory

  2. a process tries to access a page whose c memory

  3. a process tries to access a page whose p cache

  4. a process tries to access a page whose p

//i already added this one

Lol 2?

Not in cache is the answer

thread as these system calls do for a process:

  1. execlp()

  2. wait()

  3. waitpid()

  4. fork()

Paging is an example of what type of memory Fixed partition noncontiguous memory

management? allocation (thanks)

1.

Variable partition noncontiguous memory

allocation

2.

Fixed partition contiguous memory allocation

3.

Variable partition contiguous memory

allocation

4.

Fixed partition noncontiguous memory

allocation

The weakness of the Preliminary Peterson

Algorithm 4 for Mutual Exclusion is:

1 Deadlock

.

4

It contains linked list pointers used in

ready and wait queues

It includes information on the process's

state.

It stores the address of the next

instruction to be processed by a

different process

It determines which process to execute

next.

wait queues

It includes information

on the process’s state

Your right 100%

What are the names of the processes (threads) associated with

the bounded buffer problem from the lectures?

  1. Producer

  2. Consumer

  3. Semaphor e

  4. Peterson

3 and 4?

3. virtual memory

4. logical memory +

4 is good

The number of processes that are completed per unit time

is known as throughput

The state of the currently running process is saved and the state

of the next process to run is restored by which item?

  1. Named pipes

  2. Context switch

3. POSIX
  1. Multithreading

2

The following item(s) are benefits offered by thread pools used

within a multithreaded pattern to service client requests as

discussed in lectures:

1 The number of simultaneous threads to . service client requests is bounded.

2 Each client request will not require a . pthread_create() call.

3 Client requests will not be rejected, but . the handling of a request may only be delayed until a thread in the pool becomes available.

ALL

turn variables is an example of which item? 2

while flag and turn == 2 do

End

1.

bounded waiting

2.

spinlocks

3.

atomic instructions

4.

race conditions

A process may visit which of the following states on multiple 1

occasions during its lifetime? 2

1. Running

2. Waiting

3. Ready

4. Terminated

5. New

The major categories of interprocess communication are: 2 and 3

  1. Daemon

  2. Shared memory

  3. Message passing

  4. File transfer protocol

A process may transition to the ready state by which item(s)? ???

1

2

1 As a newly admitted process

.

4

2 I/O event completion

.

3 Suspension from the waiting state

.

4 Resumption from the halted ready

. state

Which section of the process memory contains the invocation

records for functions wirh temporary data such as input

parameters and local variables?

  1. Stac k

  2. Data

  3. Heap

Stack

Was this document helpful?

340final old online 1 - Practice questions for final

Course: Operating Systems Principles (CSCI 340)

16 Documents
Students shared 16 documents in this course
Was this document helpful?
Welcome
Copy and paste the question and then the answer, if you do it separately
It should format a bit better
To vote on an answer, simply add + next to the answer you like
A. Bad answer +
B. good answer ++++
To look for questions, ctrl + f
If we have backtracking, go through the questions and then circle back through them as we get
ideas
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Questions Answer
A newly admitted process may only reach the running state from
which state?
Ready+
What are the names of the processes associated with the bounded 1
4
buffer problem?
1. Producer
2. Peterson
3. Philospher
4. Consumer