Operating System [3i Infotech Placement]: Sample Questions 43 - 44 of 81

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 43

Operating System
Edit

Describe in Detail

Essay▾

Explain fork () system call.

Explanation

Chart of Parent, Fork and Child
  • System call fork () is used to create processes.
  • Takes no arguments and returns a process ID.
  • Creates a new process- becomes the child process of the caller.
  • After child of child instructions in fork () are executed.

Fork

  • Returns a negative value, if the child process creation is unsuccessful.
  • Returns positive value containing the ‘process id’ , to the parent.

Process ID

  • An integer identifying a process
  • getpid () retrieves the process ID assigned to the process.
  • After system call to fork () , a simple test can identify the child.

Question 44

Operating System
Edit

Write in Short

Short Answer▾

What are the requirements for a swapper to work?

Explanation

  • The scheduling priority of swapper is highest.
  • The requirement for the swapper is to work for the process that is ready to run and resident for at least 2 seconds before swapping out that is process resided in the swap device for 2 second.
  • The swapper searches for sleeping process- searches for the processes that are ready to run for swapping, if the sleeping process is not found.
  • If requirement is not satisfied the swapper will go into the wait state.
  • It will be awaken once in a second by the kernel of the OS.

Developed by: