Re: A basic question about running a program
From: Gary Labowitz (glabowitz_at_comcast.net)
Date: 04/07/04
- Next message: Chris \( Val \): "Re: newbie exceptions question"
- Previous message: Leor Zolman: "Re: newbie exceptions question"
- In reply to: osmium: "Re: A basic question about running a program"
- Next in thread: Chris \( Val \): "Re: A basic question about running a program"
- Reply: Chris \( Val \): "Re: A basic question about running a program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 7 Apr 2004 11:28:57 -0400
"osmium" <r124c4u102@comcast.net> wrote in message
news:c511j4$2nocad$1@ID-179017.news.uni-berlin.de...
> Tony Johansson writes:
>
>
> > I'm reading a book about C++ and in this book it says something
that might
> > be wrong.
> > The question has nothing specific with C or C++ to do. It's more
general
> > understanding.
> >
> > The book says "the operating system is a program that is always
running
> when
> > no user defined program is running". But I think that's wrong I
think that
> > the operating system is running even if your used defined program
is
> > running.
> >
> > Don't you out there agree with me.
>
> I guess I see your point. But it needs some fussy definitions to
resolve
> this. A particular computer is going to select one instruction to
do next.
> Did that instruction come from a user program or from the operating
system?
> Perhaps if you think of the user and OS as being "interlaced" it
might
> clarify things. Bottom line it comes down to what does "running"
mean?
And I add....
Only one program at a time is ever "running" in a single processor
system. You can think of multiprogramming as the processor switching
back and forth between "running" programs. The program that does the
switching (giving up control of the processor while some other program
in "running") stops "running" until the switched-to program gives up
control voluntarily or is interrupted by the hardware, usually with a
timer or I/O interruption. Then the switching program gets control
again and switches to another program, answers pending user interface
actions, etc.
HOWEVER, even this "running" program (called the operating system in
most cases) can give up control of the processor and enter what is
know as the wait-state. At that point one could argue that NO program
is "running." And you'd be right. The hardware, however, keeps right
on ticking and responding to hardware interruptions (like the user
hitting a key, or a timer interruption, or an external signal from
another system, etc.). There are several standard interruptions of
this type: hardware, I/O, timer, external. If you consider the clock
chip cycling as "running" then that prom is running -- but no
memory-resident program is.
-- Gary
- Next message: Chris \( Val \): "Re: newbie exceptions question"
- Previous message: Leor Zolman: "Re: newbie exceptions question"
- In reply to: osmium: "Re: A basic question about running a program"
- Next in thread: Chris \( Val \): "Re: A basic question about running a program"
- Reply: Chris \( Val \): "Re: A basic question about running a program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|