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 threads? A thread is alike to sequential programs. Single threads have a beginning, sequence and end. At any given point in time during the runtime of the thread there

Describe the differences among short-term, medium-term, and long-term scheduling.   Short-term (CPU scheduler)-selects from jobs in memory those jobs that are ready to execu

The dynamic memory allocator is a layer between the application and the OS, managing heap objects. When a program requests memory from the allocator (via malloc(), for instance), t

What are the three main activities of an operating system in regard to memory management? Keep track of which parts of memory are now being used and by whom. Decide which pr

why we say " OS is a resource allocator" and “OS is a control program"?

Q. When a process creates a fresh process using the fork() operation which of the following state is shared among the parent process and the child process? 1 Stack 2 Heap

what are disadvantages of using single directory

how fat file system is organised

Define the Programming Fundamentals for Client- Server Developers Coding for client - server enforces good programming fundamentals. In order for applications to become client

Define a loader that is executed when a system is first turned on or restarted? Bootstrap loader is executed when a system is first turned on or restarted