Re: A basic question about running a program

From: Gary Labowitz (glabowitz_at_comcast.net)
Date: 04/07/04


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


Relevant Pages

  • Re: A basic question about running a program
    ... You can think of multiprogramming as the processor switching ... | switching (giving up control of the processor while some other program ... The hardware, however, keeps right ... | hitting a key, or a timer interruption, or an external signal from ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Tone controls
    ... control unit, but as for the input impedance being at 1 meg-ohm (500 ... The source impedance would not be a factor here, as long as it is less ... For the input switching, I would use a very good quality mechanical ... As for the details of your tone control circuits, ...
    (sci.electronics.misc)
  • Quantum Gravity 220.1: Bang-Bang and Switching Control
    ... In Bang-Bang Control in Optimal Control Engineering and Mathematics ... Switching Control is often closely related to Bang-Bang Control, ... The papers have tended to increase in number ...
    (sci.physics)
  • Re: Systolic array architectures
    ... > compression hardware blocks (e.g. convolution filters, ... In fact only the serial solution has an area and switching overhead for ... the hardware only 1% of the time. ... improved number of computations of the serial algorithm. ...
    (comp.arch.fpga)
  • Re: [PATCH 1/1 2.6.15-rc4-git1] Fix switching to KD_TEXT
    ... to have an unconditional call to set_parfor every console switch. ... I do run relatively slow hardware, ... Kernel is a 2.6.15-rc4-git1 with my current cyblafb + your patches needed for cyblafb ... Switching from X to the console could be optimized a lot, I´m shure that you do agree. ...
    (Linux-Kernel)