Chapter 6. Thread Synchronization

The last chapter showed how processes could create additional threads to carry out background tasks or to wait for some event to occur. However, using threads is not as simple as creating a new thread and leaving it to execute. Since all threads running in an application share the same global resources and variables, there is always the chance that two threads will attempt to access the same resource at the same time. Such simultaneous access of a global resource may cause the program to fail. Because of the way the threads are scheduled, the problems caused by simultaneous access of a global resource will not occur every time the program is run. Typically such synchronization problems occur rarely enough to ...

Get Windows® CE 3.0 Application Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.