E
Ed Prochak
... snip ...No - the sort of thing that goes on is that various processes are
multi-tasked, without ever doing anything multi-tasking specific.
Or, for example, you ask for terminal input. The system doesn't
waste its time checking for keypresses. It goes off and does other
things until a keypress occurs, and then returns and presents its
result. No multitasking games required. But arranging for that
keypress to be reported on occurence is actually complex, and
probably involves various bufferes, interrupts, timers, process
priorities, whatever. It's in the OS, not the program.
However for many applications multithreading can dramatically improve
performance, since on most systems thread switching is much faster than
process switching. Another incraesingly important advantage of
multithreaded programs is that their threads can be scheduled
simultaneously under multiple CPUs or under multiple cores of a single
CPU. This _cannot_ be done with a program with single thread of
execution.
Consider a GUI program that compresses data and prints the progress in a
graphical window. []
As you can probably see multiple threads in a program makes life easier
in many types of programming tasks.
No one said multithreading is not helpful. Just as structured
programming, networking, multiprocessing, and many other methods and
features are helpful. They just are outside the scope of discussion
here. They might belong in comp.software-eng,
comp.os.linux.networking, comp.os.linux.programming, or any of the
other many comp.* groups.
And if you want to discuss flowers, take it to rec.gardening. You can
see that flowers make life more pleasant don't you?
Ed