Making Asynchronous Tasks Thread Safe

See this solution to making writing a file thread safe

(more…)

Making Class Variables and Objects Thread Safe

Simple Locking Approach

using namespace System::Threading;
Create a flag

(more…)

Sleep


using namespace System::Threading;

Pause

This allows you to literally pause execution where you are in the current function – it just pauses this thread
(more…)

Start a new process in another thread


using namespace System::Threading;

New process must be in a seperate class

(more…)

Thread Safe Calls

If your application is doing asynchronous things, for instance a form has a callback function from a class receiving say some communications, then you will need to deal with calls to it in a thread safe way. The reason is that forms run on a single thread, but events in the other class will not necessarily be on the same thread. So to deal with this… (more…)