What happens when you execute a program in unix, Operating System

 

When you run a program on your UNIX system, the system prepares a special environment for that program. This environment owns everything needed for the system to execute the program as if no other process were running on the system. Each and every process has process context, which is everything that is simple about the state of the program you are currently running. Every time you run a program the UNIX system does a fork, which acts a series of operations to make a process context and then execute your program in that context. The steps add the following:

 

  • Locate a slot in the process table, a list of currently running process kept by UNIX.
  • Give a unique process identifier (PID) to the program.
  • Copy the text of the process, the parent that requested the spawning of the new program.
  • Give the new PID to the parent process. This active the parent process to control or examine the process directly.
  • After the fork is complete, UNIX executes your program.

 

 

Posted Date: 7/28/2012 8:42:46 AM | Location : United States







Related Discussions:- What happens when you execute a program in unix, Assignment Help, Ask Question on What happens when you execute a program in unix, Get Answer, Expert's Help, What happens when you execute a program in unix Discussions

Write discussion on What happens when you execute a program in unix
Your posts are moderated
Related Questions
Signal handling A signal is used in UNIX systems to inform a process that a particular event has occurred. 1. A signal is produced by the occurrence of a particular event.

Q. What are the five main activities of an operating system in regard to process management? Answer: a. The creation as well as deletion of both user and system processes


What are kernels and what do kernels do? The kernel is a program that comprises the central core of a computer operating   system. It has entire control over everything that

Broken data into small packets allow time division multiplexing. In TDM every packet leaves the sender and is switched on the shared interaction channel through a multiplexer. At t

Question: (a) Modern processors operate in one of two modes: one for the operating system and one for applications. What is the purpose of having these two modes? What are

Deadlock Avoidance It's a method to evade deadlock by careful resource scheduling. This approach to the deadlock problem foresees deadlock before it actually occurs. This a

List disadvantages of using a single directory. Users have no privacy. Users must be careful in choosing file names, to avoid names used by others. Users may destroy each othe

What is Multiprogramming? Multiprogramming is the capability of am operating system to support multiple applications running concurrently. Multiprogramming simply means that an

Describe the differences between symmetric and asymmetric multiprocessing. What are three advantages and one disadvantage of multiprocessor systems? Symmetric multiprocessing t