Leadership let me modify part of the program, I found a problem in the process of modification, the form of the old program with a lot of the Timer, there is also a part of the thread,
But program USES CheckForIllegalCrossThreadCalls=false statements, the inquiry found that the statement is used to cross thread calls don't need to be adopted to entrust, can be called directly,
In the update offline map primitive state, use a thread to update, but found that primitive update very slow, very few primitives, but update speed like a snail in climbing, so repeatedly find update part why so slowly, but didn't find (based on the can directly call the UI controls), then there is no way, try the mentality of the entrusted way update primitives, the result is very good, at least a lot faster than it is,
Say so many, is actually want to know about the:
CheckForIllegalCrossThreadCalls=false statements under the condition of existence, as the direct manipulation of the UI control thread and the relationship between the main thread, to entrust and do not use in use, the difference between a
My personal understanding, independent create threads, after using the above statement, a direct call to change the part of the UI controls, can lead to a separate thread processing and the processing of the main thread down together, or wait for the mainline Cheng Youkong processing, so there will be a separate thread is not independent, don't know if I understand right?? Also please be aware that follows!!!!
CodePudding user response:
I see online explanation is CheckForIllegalCrossThreadCalls=true; When the.net UI controls on the program used for security checks, avoid deadlock, across threads right state of bugWhile CheckForIllegalCrossThreadCalls=false; .net not using UI controls for the security check, the program on programmer to avoid above all bugs, in fact or multiple threads to manipulate interface controls
CodePudding user response: