💻

Operating System MCQs

1K+ questions with answers

551

How many times the following C program prints yes? main() { fork();fork();printf("yes"); }

a only once
b twice
c four times
d eight times
Medium
View Details →
552

Which of the following calls never returns an error?

a getpid
b fork
c ioctl
d open
Medium
View Details →
553

A fork system call will fail if ______________

a the previously executed statement is also a fork call
b the limit on the maximum number of processes in the system would be executed
c the limit on the minimum number of processes that can be under execution by a single user would be executed
d all of the mentioned
Medium
View Details →
554

If exec is called immediately after forking ____________

a the program specified in the parameter to exec will replace the entire process
b all the threads will be duplicated
c all the threads may be duplicated
d none of the mentioned
Medium
View Details →
555

If a process does not call exec after forking ____________

a the program specified in the parameter to exec will replace the entire process
b all the threads should be duplicated
c all the threads should not be duplicated
d none of the mentioned
Medium
View Details →
556

What is Thread cancellation?

a the task of destroying the thread once its work is done
b the task of removing a thread once its work is done
c the task of terminating a thread before it has completed
d none of the mentioned
Medium
View Details →
557

When a web page is loading, and the user presses a button on the browser to stop loading the page?

a the thread loading the page continues with the loading
b the thread loading the page does not stop but continues with another task
c the thread loading the page is paused
d the thread loading the page is cancelled
Medium
View Details →
558

When one thread immediately terminates the target thread, it is called ____________

a Asynchronous cancellation
b Systematic cancellation
c Sudden Termination
d Deferred cancellation
Medium
View Details →
559

When the target thread periodically checks if it should terminate and terminates itself in an orderly manner, it is called?

a Asynchronous cancellation
b Systematic cancellation
c Sudden Termination
d Deferred cancellation
Medium
View Details →
560

Cancelling a thread asynchronously ____________

a frees all the resources properly
b may not free each resource
c spoils the process execution
d none of the mentioned
Medium
View Details →
561

Cancellation point is the point where ____________

a the thread can be cancelled – safely or otherwise doesn’t matter
b the thread can be cancelled safely
c the whole process can be cancelled safely
d none of the mentioned
Medium
View Details →
562

Signals that occur at the same time, are presented to the process ____________

a one at a time, in a particular order
b one at a time, in no particular order
c all at a time
d none of the mentioned
Medium
View Details →
563

Which of the following is not TRUE?

a Processes may send each other signals
b Kernel may send signals internally
c A field is updated in the signal table when the signal is sent
d Each signal is maintained by a single bit
Medium
View Details →
564

Signals of a given type ____________

a are queued
b are all sent as one
c cannot be queued
d none of the mentioned
Medium
View Details →
565

The three ways in which a process responds to a signal are ____________

a ignoring the signal
b handling the signal
c performing some default action
d all of the mentioned
Medium
View Details →
566

Signals are identified by ____________

a signal identifiers
b signal handlers
c signal actions
d none of the mentioned
Medium
View Details →
567

When a process blocks the receipt of certain signals?

a The signals are delivered
b The signals are not delivered
c The signals are received until they are unblocked
d The signals are received by the process once they are delivered
Medium
View Details →
568

In UNIX, the set of masked signals can be set or cleared using the ________ function.

a sigmask
b sigmaskproc
c sigprocmask
d sigproc
Medium
View Details →
569

The usefulness of signals as a general inter process communication mechanism is limited because ____________

a they do not work between processes
b they are user generated
c they cannot carry information directly
d none of the mentioned
Medium
View Details →
570

The usual effect of abnormal termination of a program is ____________

a core dump file generation
b system crash
c program switch
d signal destruction
Medium
View Details →
571

In UNIX, the abort() function sends the ________ signal to the calling process, causing abnormal termination.

a SIGTERM
b SIGSTOP
c SIGABORT
d SIGABRT
Medium
View Details →
572

In most cases, if a process is sent a signal while it is executing a system call ____________

a the system call will continue execution and the signal will be ignored completely
b the system call is interrupted by the signal, and the signal handler comes in
c the signal has no effect until the system call completes
d none of the mentioned
Medium
View Details →
573

A process can never be sure that a signal it has sent _____________

a has which identifier
b has not been lost
c has been sent
d all of the mentioned
Medium
View Details →
574

Thread pools are useful when ____________

a when we need to limit the number of threads running in the application at the same time
b when we need to limit the number of threads running in the application as a whole
c when we need to arrange the ordering of threads
d none of the mentioned
Medium
View Details →
575

Instead of starting a new thread for every task to execute concurrently, the task can be passed to a ___________

a process
b thread pool
c thread queue
d none of the mentioned
Medium
View Details →
576

Each connection arriving at multi threaded servers via network is generally ____________

a is directly put into the blocking queue
b is wrapped as a task and passed on to a thread pool
c is kept in a normal queue and then sent to the blocking queue from where it is dequeued
d none of the mentioned
Medium
View Details →
577

What is the idea behind thread pools?

a a number of threads are created at process startup and placed in a pool where they sit and wait for work
b when a process begins, a pool of threads is chosen from the many existing and each thread is allotted equal amount of work
c all threads in a pool distribute the task equally among themselves
d none of the mentioned
Medium
View Details →
578

If the thread pool contains no available thread ____________

a the server runs a new process
b the server goes to another thread pool
c the server demands for a new pool creation
d the server waits until one becomes free
Medium
View Details →
579

Thread pools help in ____________

a servicing multiple requests using one thread
b servicing a single request using multiple threads from the pool
c faster servicing of requests with an existing thread rather than waiting to create a new thread
d none of the mentioned
Medium
View Details →
580

The number of the threads in the pool can be decided on factors such as ____________

a number of CPUs in the system
b amount of physical memory
c expected number of concurrent client requests
d all of the mentioned
Medium
View Details →
581

Because of virtual memory, the memory can be shared among ____________

a processes
b threads
c instructions
d none of the mentioned
Medium
View Details →
582

_____ is the concept in which a process is copied into the main memory from the secondary memory according to the requirement.

a Paging
b Demand paging
c Segmentation
d Swapping
Medium
View Details →
583

The pager concerns with the ____________

a individual page of a process
b entire process
c entire thread
d first page of a process
Medium
View Details →
584

Swap space exists in ____________

a primary memory
b secondary memory
c cpu
d none of the mentioned
Medium
View Details →
585

When a program tries to access a page that is mapped in address space but not loaded in physical memory, then ____________

a segmentation fault occurs
b fatal error occurs
c page fault occurs
d no error occurs
Medium
View Details →
586

Effective access time is directly proportional to ____________

a page-fault rate
b hit ratio
c memory access time
d none of the mentioned
Medium
View Details →
587

Which algorithm chooses the page that has not been used for the longest period of time whenever the page required to be replaced?

a first in first out algorithm
b additional reference bit algorithm
c least recently used algorithm
d counting based page replacement algorithm
Medium
View Details →
588

A process is thrashing if ____________

a it is spending more time paging than executing
b it is spending less time paging than executing
c page fault occurs
d swapping can not take place
Medium
View Details →
589

Working set model for page replacement is based on the assumption of ____________

a modularity
b locality
c globalization
d random access
Medium
View Details →
590

Virtual memory allows ____________

a execution of a process that may not be completely in memory
b a program to be smaller than the physical memory
c a program to be larger than the secondary storage
d execution of a process without being in physical memory
Medium
View Details →
591

The instruction being executed, must be in ____________

a physical memory
b logical memory
c physical & logical memory
d none of the mentioned
Medium
View Details →
592

Error handler codes, to handle unusual errors are ____________

a almost never executed
b executed very often
c executed periodically
d none of the mentioned
Medium
View Details →
593

The ability to execute a program that is only partially in memory has benefits like ____________

a The amount of physical memory cannot put a constraint on the program
b Programs for an extremely large virtual space can be created
c Throughput increases
d All of the mentioned
Medium
View Details →
594

In virtual memory. the programmer __________ of overlays.

a has to take care
b does not have to take care
c all of the mentioned
d none of the mentioned
Medium
View Details →
595

Virtual memory is normally implemented by ________

a demand paging
b buses
c virtualization
d all of the mentioned
Medium
View Details →
596

A swapper manipulates ___________ whereas the pager is concerned with individual _______ of a process.

a the entire process, parts
b all the pages of a process, segments
c the entire process, pages
d none of the mentioned
Medium
View Details →
597

Using a pager ____________

a increases the swap time
b decreases the swap time
c decreases the swap time & amount of physical memory needed
d increases the amount of physical memory needed
Medium
View Details →
598

The valid – invalid bit, in this case, when valid indicates?

a the page is not legal
b the page is illegal
c the page is in memory
d the page is not in memory
Medium
View Details →
599

A page fault occurs when?

a a page gives inconsistent data
b a page cannot be accessed due to its absence from memory
c a page is invisible
d all of the mentioned
Medium
View Details →
600

When a page fault occurs, the state of the interrupted process is ____________

a disrupted
b invalid
c saved
d none of the mentioned
Medium
View Details →