Home > Net >  C # asynchronous multi-threaded parallel running speed is not stable
C # asynchronous multi-threaded parallel running speed is not stable

Time:10-24

C # asynchronous multi-threaded parallel running speed is not stable, such as normal 400 milliseconds, begin to run for a period of time 800 milliseconds, then the normal 400 milliseconds.

CodePudding user response:

Do you check your computer's performance there is a problem

CodePudding user response:

Very normal, thread, the task is representative are parallel ability, only blog garden to take partial, those people became BuKa, concurrent, quick

But this is all appearances:
Can parallel -- -- -- -- -- -- -- -- -- -- -- so he can run multiple tasks at the same time, so the computing task will not interfere with the display of the task, so BuKa
Thread task -- -- -- -- -- -- -- -- -- are parallel not concurrently, concurrency control lock, is a semaphore, not threads and task
Fast -- -- -- -- -- -- -- -- -- -- - the only macroscopic standard, because the system can be parallel, so not because of a slow jam processing process, so the macro performance quickly, assuming a tasks at the same time, there are two unrelated subtasks, the two subtasks can be run at the same time, so the serial fast (the most common explanation is that cooking and cooking, cooked rice, food is almost)

But -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- the thread, the task is based on CPU concurrent, he used a time slice to switch back and forth, so the micro on his time and the number of threads you system, thread priorities,
Such as 1000 threads execute simultaneously and 100 threads execute simultaneously he certainly is not the same as on the micro right, after all, eight nuclear (assuming the 8 cores), switching back and forth to do, cut cut 10000 and 100, there is always a thread cheated, take advantage of it have thread

CodePudding user response:

Have set the background have baa set delay time

CodePudding user response:

No delay!!!!!

CodePudding user response:

Fundamental reason for this phenomenon is the second floor.
In addition you have to consider, your application will depend on the process of the asynchronous execution time? If rely on, I think as a design has a problem, can say, you need to discuss.
  •  Tags:  
  • C#
  • Related