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
Q. Explain about Functions of Operating System? Functions of Operating System Operating system performs 3 functions as follows: 1.  Convenience:   Operating System mak

Producer-Consumer Problem Using Semaphores The Solution to producer-consumer problem use three semaphores namely- full, empty and mutex. The semaphore 'full' is utilized for

discuss unsafe state in operating system

Q. Timers could be utilized to compute the current time. Provide a little description of how this could be accomplished. Answer: A program could utilize the following ap

how do semaphores help us in eliminating deadlock conditions?

Indexed allocation Indexed allocation bringing all the pointers together into one location: the index block. Every file has its own index block, which is an array of disk-block

What is real time system? A real time system has well explained, fixed time constraints. Processing must be done within the explained constraints, or the system will fail. It i

Describe the following allocation algorithms: a. First fit b. Best fit c. Worst fit   a. First-fit: search the list of available memory and all

Define the OS/2 threads code The sample program in Listing is very similar to the NetWare example. OS/2 commands are substituted for the pseudocode commands controlling thread

what is the meaning of co-operating process?