Languages [3i Infotech Placement]: Sample Questions 18 - 19 of 546

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

Question 18


Describe in Detail


What is difference between process and thread?


Table of Difference between Process and Thread
Heavy weightLight weight
Has its own memory space.Use memory of the process they belong to
Inter process communication is slow as processes have different memory address.Inter thread communication is fast as threads of the same process share the same memory address.
Context switching between the process is more expensive.Context switching between threads of the same process is less expensive.
Processes don՚t share the memory with other process- consider privacy and securityThreads share the memory with other threads of the same process- consider privacy and security

Question 19


Write in Short

Short Answer▾

What is the output of the following program?

  1. main()
  2. {
  3.     Main();
  4. }


  • Runtime error: stack overflow.
  • Main function calls itself repeatedly.
  • Each time the function is called its return address is stored in the call stack.
  • Since there is no condition to terminate the function call, the call stack overflows at runtime.
  • So it terminates the program and results in an error.

Developed by: