L
Lars Uffmann
Hey everyone!
In a previous post, I was asking about thread programming in C++ and was
pointed to the boost libraries. However, now I am reading in the
boost.thread documentation at
http://www.boost.org/doc/html/thread.html#thread.glossary / Table 15.26
for Thread State that "Running" means: "Currently executing on a
processor. Zero or more threads may be running at any time, with a
maximum equal to the number of processors."
So does that mean multithreading is only intended for multi-processor
environments? What I was thinking about was actually more like... handle
network data in a procedure (which I thought would be a thread) that is
permanently listening to incoming packets, while the rest of my
application (GUI) is still reacting to user input.
I have used a "thread" implementation of widestudio for this
successfully, so I didn't really have the idea this could be the wrong
approach.
What would be the correct approach to run several processes in parallel
on a single-core system (or regardless of the amount of cores)?
TIA,
Lars
In a previous post, I was asking about thread programming in C++ and was
pointed to the boost libraries. However, now I am reading in the
boost.thread documentation at
http://www.boost.org/doc/html/thread.html#thread.glossary / Table 15.26
for Thread State that "Running" means: "Currently executing on a
processor. Zero or more threads may be running at any time, with a
maximum equal to the number of processors."
So does that mean multithreading is only intended for multi-processor
environments? What I was thinking about was actually more like... handle
network data in a procedure (which I thought would be a thread) that is
permanently listening to incoming packets, while the rest of my
application (GUI) is still reacting to user input.
I have used a "thread" implementation of widestudio for this
successfully, so I didn't really have the idea this could be the wrong
approach.
What would be the correct approach to run several processes in parallel
on a single-core system (or regardless of the amount of cores)?
TIA,
Lars