[oclug] Re: What is a process in relation to an application?
Adrian Irving-Beer
wisq-oclug at wisq.net
Sun Sep 25 19:32:07 EDT 2005
On Sun, Sep 25, 2005 at 01:39:04PM -0400, William Case wrote:
> I know what a process is (I think) in relation to memory addresses,
> the cpu and the kernel.
Right. AFAIK, processes are individual autonomous series of
operations that are allocated their own private execution time and
storage memory by the system.
> I have two text books describing Operating Systems (mainly UNIX and
> Linux) written by William Stallings and Andrew Tanenbaum. They
> describe the workings of operating systems and CPU in terms of short
> processes (and threads) that take maybe nanosecs or msecs to
> complete.
By the numbers, these are the most common kind, yes. After all, every
command you type, and almost every command in every shell script, is
going to launch a super-quick process. It can take thousands of these
just to get the system into a usable state.
My X display manager (the last part of my startup) has a PID of over
4400. My shell takes almost 30 processes just to handle my somewhat
complex profile.
> Are applications also processes or are they broken into much smaller
> processes ?
They can be either. Apache is several processes. Something like
Oracle (I think) may elect to use multiple threads instead. My web
browser, Konqueror, is a single process per se, but slaves out most of
its other operations (DCOP, HTTP retrieval, etc.) to other processes.
However, their decision will always reflect on the 'ps' output. They
can't spawn multiple long-running processes without you seeing them.
They can run very short ones, of course, but you can determine this
easily -- you'll notice the process ID of your 'ps' command keeps
increasing.
> The gui part of an application, for example, is run as a separate
> process of say gnome-session, metacity, nautilus, n'cest-pas?
No. They communicate with X (also a single process), but most will do
so while remaining a single process.
> Stallings says threads are not used in Linux. Tanenbaum says
> threads are used but only under special circumstances and their use
> cannot be ported from Linux to Unix.
I suppose it depends on your definition. I haven't used threads much,
but I *think* they're a function of GNU libc, with some kernel
cooperation. They're becoming more common, but still remain fairly
rare, I find.
Note that multiple threads will show up as multiple processes in
Linux. That's the official kind of thread, anyway. For example, Java
may have multiple threads internally, but handles it all via the JVM,
so it'll show up as a single process.
> Are the processes for something like oowriter, made up of each
> individual feature in an application? I.E is typing a sentence a
> process separate from the 'inserting a table' process which is
> separate from the recording 'new styles' process.?
I would doubt this, but I don't use OO, so I don't know.
> Or, does the kernel have to search through the entire application
> code to find each of these features?
None of the above. I'm pretty sure it's all just handled via symbol
tables, so it knows where to find everything. No 'search' is needed.
> I don't need to know how each of these application features may be
> accomplished but I am trying to confirm to myself that what I am
> studying about processes does or does not apply to large
> applications in any unique way.
That would be my impression.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://tux.oclug.on.ca/pipermail/oclug/attachments/20050925/af79fab4/attachment.pgp
More information about the OCLUG
mailing list