Information Technology Reference
In-Depth Information
#thisprogramcompilessourcefile1.candsourcefile2.c
#andthenlinkstheresultstogetherintoanexecutableprogram
cc-csourcefile1.c
cc-csourcefile2.c
ln-oprogramsourcefile1.osourcefile2.o
There is an app for that
User-level process management is another way of saying “there is an app for that.”
Instead of a single program that does everything, we can create specialized programs
for each task, and mix and match what we need. The formatting system for this textbook
uses over fifty separate programs.
The web is a good example of the power of composing complex applications from
more specialized services. A web page does not need to do everything itself: it can
mash up the results of many different web pages, and it can invoke process creation
on the local server to generate part of the page. The flexibility to create processes was
extremely important early on in the development of the web. HTML was initially just a
way to describe the formatting for static information, but it included a way to escape to
a process to, say, do a lookup in a database or to authenticate a user. Over time, HTML
has added support for many different features that were first prototyped via execution
by a separate process. And of course, HTML still retains the ability to execute a process
for everything not supported by the standard.
sourcefile2, and a process to link them together. Once a shell script is a program,
we can create other programs by combining scripts together. In fact, on UNIX,
the C compiler is itself a shell program! The compiler first invokes a process to
expand header include files, then a separate process to parse the output, another
process to generate (text) assembly code, and yet another to convert assembly
into executable machine instructions.
3.1.1
Windows process management
One approach to process management is to just add a system call to create a
process, and other system calls for other process operations. This turns out to
be simple in theory and complex in practice. In Windows, there is a routine
called, unsurprisingly, CreateProcess , in simplified form below:
We call the process creator the parent and the process being created the
Denition: parent
child .
.Definition: child
What steps does CreateProcess take?
As we explained in the previous
chapter, the kernel needs to:
Create and initialize the process control block (PCB) in the kernel
Search WWH ::




Custom Search