Log_content"
I recently wrote software to the customer and found that I have not found any errors on this side. However, when the customer's software runs multiple threads, an error occurs and the problem cannot be found. After a long time, I found a solution, it turned out to be a CPU problem. multithreading has a problem with dual-core CPU affinity. Now we can find a solution to the problem. By the way, let's record that some friends may encounter the same problem. For more information, see.
DLL command:
. Version 2
. Dll command setprocessaffinitymask, integer type, public, set CPU affinity Process Handle returned CPU number
. Parameter hprocess, integer type
. Parameter hprocess, integer type
. Dll command setthreadaffinitymask, integer type, public, set CPU affinity thread handle
. Parameter hprocess, integer type
. Parameter mask, integer type
. Dll command getcurrentprocess, integer type, public, get a pseudo handle of the current process is generally-1
. Dll command getcurrentthread, integer type, public, get a pseudo handle of the current thread is generally-2
Put the following code into the easy code:
Setprocessaffinitymask (-1, 1)
"