answersLogoWhite

0

What happens when you run a program?

Updated: 9/27/2023
User Avatar

Wiki User

11y ago

Best Answer

When you execute a program on your UNIX system, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system. Each process has process context, which is everything that is unique about the state of the program you are currently running. Every time you execute a program the UNIX system does a fork, which performs a series of operations to create a process context and then execute your program in that context. The steps include the following:

Allocate a slot in the process table, a list of currently running programs kept by UNIX.

Assign a unique process identifier (PID) to the process.

iCopy the context of the parent, the process that requested the spawning of the new process.

Return the new PID to the parent process. This enables the parent process to examine or control the process directly. After the fork is complete, UNIX runs your program.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What happens when you run a program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Basic Math

What is difference between multi tasking and multiprogramming?

MultiTasking:In MultiTasking operating system, several jobs are executed in parallel by the operating system, through multiple processors (or) CPUs only.Like .CPU1: Job-ACPU2: Job-BCPU3: Job-CMultiprogramming :The method of Multiprogramming systems comes in the 1960s. In that process several different programs in batch were loaded in the computer memory, and the first one began to run. One program after another executed when the first program reached an instruction waiting for a device that has a message, the context of this program was stored away, and the second program in memory was given a chance to run. The process continued until all programs finished running.By : er.karthikchawda@gmail.com


How can you run a php program?

To run PHP, just like any other programming/scripting language, you need to install an interpreter.If you're planning on using the PHP on a website, you can have a PHP interpreter run alongside your Apache/Nginx installation. Go ahead and look up the relevant installation information for your server's OS.


What is the What is the difference between program and program?

Program is the US spelling.Programme is the UK spelling.


How i will write a program in qbasic -to display your name multiple times using do whileloop?

QBASIC code/Editor Screen (Press key [F5] to make the program RUN/execute...) ==== (Pressing any key returns you straight back to the Editor screen; where you can either chose to further Edit/Re-Run/or else, Save your program.) Here is another example. CLS COLOR 15, 4, 14 PRINT "Press any key to continue" DO WHILE INKEY$ = "" LOOP FOR c = 1 TO 20 COLOR c, 0 PRINT "Replace this with the name you want to display" NEXT c COLOR 15, 0 END


Difference between debugging and maintaining program?

Debugging makes the program works fast while maintainance makes the program slow

Related questions

What is run time in java?

That refers to anything that happens while you run the program. For example, the compiler may detect certain problems while you compile the program, but certain errors are bound to happen only when you actually run the program - i.e., at runtime.


What happens when you ntry to run amother program when disk defragmentor is running?

just bring to bottom, and go to another program, when defrag. is on, click on --


Where and how can I run a program?

You can run a program in any OS. For example an executable program can be run in windows by .exe file extension.


Will a program run if it is placed into ROM?

a program will only run if it is first place into


The program which automatically run and continues to run as long as Windows is running is?

Program Manager


Can you run java program without applying main method?

yes we can run java program without using main. we can run program by declaring the variable static..


What happens if the static modifier is removed from the signature of the main program in java?

Actually speaking nothing major happens. That method would become just another method in the class. You cannot use that as the method to begin the program execution in your class. Your class will not be a standalone java program and you cannot execute it like you did before using the public static void main() method.


Which program would you run to check for possible disk errors and where is the program located?

program would you run to check for possible disk errors


What is execution of program?

Exec. Of program is the compilation of document or the run of a type program.


What program is needed to run to edit the files that run at start up?

Sysedit is the Windows Program by which you can edit the files that run at startup. To run Sysedit it is typed in Start-->Run box.


Who execute a program?

Anobody who uses it is said to "execute" or "run" the program.Anobody who uses it is said to "execute" or "run" the program.Anobody who uses it is said to "execute" or "run" the program.Anobody who uses it is said to "execute" or "run" the program.


A program without an extension name CPP will run?

Yes because a program can run without a CPP extension, especially if program extension is .exe