Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

What goes on inside CPU when a process is loaded?

Posted on 1998-09-28
2
Medium Priority
?
232 Views
Last Modified: 2010-04-21
null
0
Comment
Question by:ashfawad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
braveheart earned 150 total points
ID: 2007108
The operating system does not necessarily know how much space to allocate to a program beforehand. It knows how much code space and data space because these contain the instructions and constants that make up the program. The stack segment grows and shrinks according to the run time requirements of the program.

For instance, when a subroutine or function is called, the context of the calling routine has to be saved by pushing values of variables on to the stack. Similarly some call might allocate a block of memory to the program - the operating system can not know this until run time, so the stack grows and shrinks as necessary.

Different strategies are used by different systems: some might allocate a fixed maximum to the size of the stack, while others will include the stack in virtual memory so that it can grow and shrink without limit and so that it any memory not used is available to other processes.

If you execute vi on any file, the data segment contains the constants in the vi program, not any data associated with the file. The file remains stored on disk, although some of its contents may be cached in local memory and, almost certainly, things like file descriptors may be stored in the stack segment of the process, if the vi program requires it.

An I/O wait is as long as it takes. The scheduler will judge whether the file reading process is waiting for I/O and, if the I/O transfer is not yet complete, it will go on to the next process. The length of wait depends on the speed of your disks, or network, the speed of your CPU... you name it.

Why not read "Fundamentals of Operating Systems" by A.M.Lister, published by Macmillan. It is a bit old but is very UNIX oriented.
0
 

Author Comment

by:ashfawad
ID: 2007109
Thanks for the answer and also the  book. I I hope thsi book does not confuse me further. None of the books give detailed explaination. They miss out a lot of things.

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question