Home > Back-end > Who knows Rad studio10.2 64 create a thread slow problem
Who knows Rad studio10.2 64 create a thread slow problem
Time:09-16
32-bit no problem, switching to a 64 - bit, with all kinds of way to create a thread is very slow, 100 threads require a minute or so, (1) the CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) funs, NULL, 0, NULL); (2) the _beginthread (funsss, 0, NULL); (3) (HANDLE *) _beginthreadex (NULL, 0, fun, (void *) this, CREATE_SUSPENDED, NULL); ResumeThread (threadHandle); (4) the thread t (funss); T.d etach (); (5) * secondProcess TMyThread; SecondProcess=new TMyThread (True);//Creation is suspended, the second process does not run yet. SecondProcess - & gt; FreeOnTerminate=True;//Do not need to clean up after termination. SecondProcess - & gt; Priority=tpLower;//Set the priority to the lower than normal. SecondProcess - & gt; Resume ();//Now run the thread.
More than five ways to create a thread are tried, 32 bit fast, 3 seconds can create complete, but 64 will take at least a minute, who is a great god can answer why?
Use the compiler is rad studio 10.2
CodePudding user response:
Try using the Release mode, in the DEBUG mode, create a thread is a card