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
What are files and explain the access methods for files? File definition Attributes, operations and types Direct access Sequential access with diagram Other access

Second chance Algorithm When the page is chosen the reference bit is checked to see whether it has been referenced before. If that is the case after that it is given a second c

What are turnaround time and response time? Turnaround time is the interval among the submission of a job and its completion. Response time is the interval among submission

One reason to learn C and C++ is simply that so much software is written in these languages. A related, butmore fundamental reason, is that C and C++ are relatively low-level, allo

Q. How Program execute in operating system? Program execution: Operating system loads a program in memory and executes the program. The program should be able to end its exec

#questionThe Fibonacci sequence is the series of numbers 0,1,1,2,3,5,8,… Formally, it can be expressed as: fib0 = 0 fib1 = 1 fibn = fib n-1 + fib n-2 Write a C program u

ADVANTAGES OF MICROFERNEL IN YSTEM DESIGN?

Hierarchical paging method Most modern computer systems maintain a large logical-address space. In this situation the page table itself turns into excessively large. To remedy

Managing the interaction of client and server  Among the differences between traditional application programs and client server ones is that developers must create a mechanism

explain simple segmentation