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
Show the search tree generated by Hill-Climbing search (text figure 4.2, page 122; or Local Search lecture, slide 6) for each of the two heuristics (a) and (b) applied to the follo

what is hashed page tables & explain of there work & figure

explain hierarchical,hashed and inverted paging

What is a Relocatable program? The Relocatable programs can be loaded almost anywhere in memory.

Define what can be used as a criterion for classification of data structures utilized in language processing              Answer: nature of a data structure, lifetime of a dat

Present your own fully documented and tested programming example illustrating the prevention of a data race in a parallelised program. This is an example where total number of p

Explain about threading issues? The fork and exec system calls In a multithreaded program of few UNIX systems have chosen to have two versions of fork, one that duplicates e

linked allocation using i node

Explain Structure The Grammar for programming language is a formal description of Structure

Gopher Gallery consists of a shopping mall and a cart ride that covers the 150 acre habitat. There are m visitors and n single-person vehicles. Visitors stroll around the mall at t