Multi-thread Communication ?

Can somebody show some code about Multi-thread Communication.
especially sub-thread to game-thread.

Define communication.

There’s a couple ways you can have threads share information. Generally, you use Critical Sections (FCriticalSection) to lock, then write to variables that are shared by threads (e.g. a bool that says this thread has completed its work and its safe to read the result). The Critical Section allows you to prevent other threads from writing to the variable until you release the lock.

You can also have your thread queue up a bunch of events (again, using a critical section to lock the queue), and then have your other thread process those events. That’s effectively how a rendering thread works.

Hi AdeptStrain, I’m new to C++,could you please give me some code examples or tutorials about thread event? Thanks.