Solved

What goes on inside CPU when a process is loaded?

Posted on 1998-09-28
2
220 Views
Last Modified: 2010-04-21
null
0
Comment
Question by:ashfawad
2 Comments
 
LVL 3

Accepted Solution

by:
braveheart earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ftpcommand 2 56
text in table need to be center of the box 4 74
Python Assistance 7 70
How to make a Bash alias that takes parameters 5 16
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

943 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now