
264 Chapter 6 • Advanced Programming Concepts
Good threadsafe code is written by properly using multithreading and paying
attention to designing your application properly.Threadsafe code operates prop-
erly when more than one thread executes it.
You can use events to simplify thread synchronization. If a process needs to
wait for another process to finish, it can wait for the event to raise.This is done
my designing the program so that functions wait for other functions to finish
using events.
NOTE
Although the SyncLock command is helpful, it is not a substitute for
writing robust, threadsafe code. When you are developing a multi-
threaded application, proper ...