Ticker

6/recent/ticker-posts

Operating system subjective question for competitive exam part2

Q1. Diff b/w simple paging and demand paging.

Demand paging is identical to the paging system with swapping.In demand paging a page is delivered into the memory on demand only when a reference is made to a location on that page.Demand paging combines the feature of simple paging and implement virtual memory as it has a large virtual memory.lazzy swapper concept is implemented in demand paging in which a page is not swapped into the memory unless it is required.



Q2.What is thread how it is different from process.

Both process and thread are related to each other and quite similar as these are the independent sequence of execution.The basic difference b/w a process and thread is that a process take place in different memory space whereas a thread executes in the same memory space.A process is a program uder execution.Processrequire more time for context switching as they are heavier.processes are totally independent dont share memory.Thread is a lightweight process that can be manage independently by a schedular.Thread require less time for context switching.Communication b/w thread require less time.If userlevel thread blocked all of it peer threads also get blocked.Leass resources needed than process.



Q3.Explain wake-up process

If the critical section is not empty then the process will go and sleep.It will be waked up by the other process which is currently executing inside the critical section.In producer consumer problem there are two processes one process writes something while the other process reads that.The process which is writing something is producer while the process which is reading is called consumer.In order to read and write both of them are using buffer.The code that simulates the sleep and write machanism in terms of providing the solution to produce consumer problem.

Q4.Explain belady's anomaly?

Increasing the number of page frames result in an increase in the number of page faults for a given memory access pattern.The phenomenon is commonly experienced in FIFO,second chance algorithm,random page replacement algorithm.

Q5.Explain traps,subroutine calls ,interrupt.

The trap is a signal raised by user program instructing the operating system to perform some functionality immediately.It is synchronous process.It is known as software interrupt. Interrupt is a signal to the cpu emitted by hardware that indicate an event that requires immediate attention.It is asynchronous process.It is known as hardware interrupt.It is asynchronous process.It is known as hardware interrupt. Subroutine call --A related instruction is the subroutine call which transfer execution to a subprogram and then after subprogram fininsh return to the main program where it left off.



Post a Comment

0 Comments