Home > Software engineering >  I defined the main window a global variable window, the child thread using the variable postMessage
I defined the main window a global variable window, the child thread using the variable postMessage

Time:09-22

I defined the main window a global variable window, the child thread using the variable postMessage hair message, may I lock you
A novice

CodePudding user response:

Oneself the top

CodePudding user response:

Lock is what to do?

CodePudding user response:

When the child thread and thread synchronization access change variables, need to lock, or a variable's value is not determined, and easy to collapse

CodePudding user response:

PostMessage thread-safe,

CodePudding user response:

Postmessage don't need a lock

CodePudding user response:

The atomic operation of multiple threads to read and write to lock, see your particle degree of the global variables

CodePudding user response:

"Windows core programming"

CodePudding user response:

InterlockedExchange with other code is an error, you will not be ok,
  • Related