Hi all A simple question which bothers me. When a thread is created and started in main, does the two threads share the procesor, or does the one wait for the other to finish before it can run. Is the processor like say split in two if i can use the terminology so that the two threads can run at the same time. Just wondering. Hope you understand my question. Thanks for any answers. Cornel
Most machines only have one cpu. In that case every thread (aka process) shares the cpu. In the event that the machine has more than one cpu than you might have different threads running on different cpus at the same time. I don't know if any of that is important when thinking about threads. The benefit of using threads is that it frees up the cpu from having to sequentially execute all of your code. Which in many cases (but not all) can speed up your program. Than there are also some problems which you can't really solve without having some sort of multi-process ability.
Please ignore post, I have no idea what I am talking about.