I read some articles about this problem. The case seems to be not easy. I want to create two different threads in two cores. The articles that I read were too complicated. I even couldn’t create a simple thread based on those articles. On the other hand, I need to understand how many cores a computer has to make available as a choice for using both cores or just creating threads on one core. I want to do them on Windows.
Any help would be highly welcome
p.s: I am not that pro on C++. So please if it is possible guide me with easier ways.
Though it’s generally a lousy idea (the thread scheduler usually does a better job on its own), the basic idea would be:
Note that the
1<<0and1<<1could just as easily be written as1and2respectively — I was just trying to make explicit the fact that each bit position represents a processor.