Operating Systems Questions

Q:

What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem?

Answer

Thrashing is caused by under allocation of the minimum number of pages required by a process, forcing it to continuously page fault. The system can detect thrashing by evaluating the level of CPU utilization as compared to the level of multiprogramming. It can be eliminated by reducing the level of multiprogramming.


 


What_is_the_cause_of_thrashing_How_does_the_system_detect_thrashing_Once_it_detects_thrashing,_what_can_the_system_do_to_eliminate_this_problem1557490890.jpg image

Report Error

View answer Workspace Report Error Discuss

69 40963
Q:

Explain Belady's Anomaly?

Answer

Also called FIFO anomaly. Usually, on increasing the number of frames allocated to a process virtual memory, the process execution is faster, because fewer page faults occur. Sometimes, the reverse happens, i.e., the execution time increases even when more frames are allocated to the process. This is Belady's Anomaly. This is true for certain page reference patterns.

Report Error

View answer Workspace Report Error Discuss

36 21755
Q:

main()

{

fork();

 

printf(“Hello World!”);

}

Output for the above unix program is

A) Hello World! B) Hello World!Hello World!
C) Hello World D) None
 
Answer & Explanation Answer: B) Hello World!Hello World!

Explanation:

The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process

Report Error

View Answer Report Error Discuss

Filed Under: Operating Systems
Exam Prep: GRE

1 20625
Q:

What are the typical elements of a process image?

Answer

User data: Modifiable part of user space. May include program data, user stack area, and programs that may be modified.


User program: The instructions to be executed.


System Stack: Each process has one or more LIFO stacks associated with it. Used to store parameters and calling addresses for procedure and system calls.


Process control Block (PCB): Info needed by the OS to control processes.

Report Error

View answer Workspace Report Error Discuss

14 18744
Q:

What resources are used when a thread is created? How do they differ from those when a process is created?

Answer

When a thread is created the threads does not require any new resources to execute the thread shares the resources like memory of the process to which they belong to. The benefit of code sharing is that it allows an application to have several different threads of activity all within the same address space. Whereas if a new process creation is very heavyweight because it always requires new address space to be created and even if they share the memory then the inter process communication is expensive when compared to the communication between the threads.

Report Error

View answer Workspace Report Error Discuss

19 17443
Q:

List out some reasons for process termination.

Answer

- Normal completion


- Time limit exceeded


- Memory unavailable


- Bounds violation


- Protection error


- Arithmetic error


- Time overrun


- I/O failure


- Invalid instruction


- Privileged instruction


- Data misuse


- Operator or OS intervention


- Parent termination.

Report Error

View answer Workspace Report Error Discuss

22 16866
Q:

What is a binary semaphore? What is its use?

Answer

A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes.

Report Error

View answer Workspace Report Error Discuss

9 14847
Q:

Define latency, transfer and seek time with respect to disk I/O.

Answer

Seek time is the time required to move the disk arm to the required track. Rotational delay or latency is the time it takes for the beginning of the required sector to reach the head. Sum of seek time (if any) and latency is the access time. Time taken to actually transfer a span of data is transfer time.

Report Error

View answer Workspace Report Error Discuss

14 14796