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
difference between soft link and hard links

What is an I/O subsystem? The control of devices connected to the computer is a main issue while designing operating systems. Because I/O deices differ widely in their function

What are the services provided by the operating systems?  Program Development It provides a variety of services and facilities, such as debuggers and editor, to help the

What is dispatch latency? The time taken by the dispatcher to stop one process and begin another running is known as dispatch latency.

Q. What are the three main activities of an operating system in regard to secondary-storage management? Answer: 1) Free-space management 2) Storage allocation 3) Disk

Question : a) Describe the difference between the authentication of a user account on a peer to peer network and a client server network. b) Compare an end user account with

Explain FIFO page replacement A FIFO replacement algorithm associates with every page the time when that page was brought into memory. When a page must be changed, the oldest p

What is macro expansion

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

wat are the commands used for creating the file hierarchy