Home > Net > Would like to ask the question in respect to multithreading
Would like to ask the question in respect to multithreading
Time:11-28
Suppose you have an 8 16 thread CPU core
1. The multi-core CPU core, at the time of calculation is based on a core 2 threads, or 16 threads directly calculate? 2. If it is one core two threads, so want to take advantage of multithreaded only need to open a thread? Multi-threading CPU is a little less so? We'll need to open a process to play other core thread? So I think this is wrong, need bosses refers to the way? 3. If in fact calculation has always been a thread instead of the core, if 16 threads execute together, just want to take advantage of multithreaded only theoretically need to open 15 thread? So it can always use 16 threads? I calculate and open a thread, it is to wait for a spare CPU thread
CodePudding user response:
And round does not explain, and you just want to say the CPU parallel
We don't want to explain, "c # Paralle" baidu "c # thread pool thread scheduling," Windows isn't what you said the thread open thread, his own schedule, and round don't, don't you talk 1 w a thread, we want to high 5000 kcpu run?
CodePudding user response:
How to run a system is the thing, it is not you
You have to do is tell the system, I need to schedule a task, probably by what rules need to allocate (arrangement as soon as possible/I don't worry I can slowly), how high priority, use what the scheduler to schedule, this will do,
Other things let the system arrangement to you, after all, you are writing the application, not write the operating system
CodePudding user response:
Multicore multi-threading, at the time of calculation, it should be only one thread in the calculation, it can only handle A calculation at the same time, only the computer speed is too fast, it will be A computing three milliseconds, B processing three milliseconds, cycle time is not sure, seems to have A call turn time segments, So want to take advantage of multithreaded only need to open a thread? Multi-threaded concurrent is the advantage of, is to do two thing at the same time, it would be a bit faster, than the single thread a bit faster, but not the more the better, because the thread when switching seems to have consumption, efficiency is not 1 + 1=2
CodePudding user response:
Even 2 nuclear, you open the 100 threads are ok, these are the two concepts