Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows C++ Process vs Thread

In Windows C++, createThread() causes some of the threads to slow down if one thread is doing a very CPU intensive operation. Will createProcess() alleviate this? If so, does createProcess() imply the code must reside in a second executable, or can this all take place inside the same executable?

like image 887
rossb83 Avatar asked Dec 22 '22 15:12

rossb83


1 Answers

The major difference between a process and a thread is that each process has its own memory space, while threads share the memory space of the process that they are running within.

If a thread is truly CPU bound, it will only slow another thread if they are both executing on the same processor core. createProcess will not alleviate this since a process would still have the same issue.

Also, what kind of machine are you running this on? Does it have more than one core?

like image 94
Justin Ethier Avatar answered Jan 04 '23 02:01

Justin Ethier