by Soumya Gupta, Technical Marketing Engineer
Software Solutions Group, Intel Corporation
Synchronization is essential in programming for multi-threaded applications because concurrent access to shared data may result in data inconsistency since threads normally run asynchronously. The program PrintNumbers.c, which you can download below, is a program that creates multiple threads and displays the thread Ids. The example illustrates that the results of the program running multiple threads can be very unpredictable. Because of this, programmers must examine ways to synchronize threads. For a detailed discussion of how to provide thread synchronization to ensure that you get the results you expect from a program see Multithreaded Programming in a Microsoft Win32 Environment.
Web developers, developers building application server code, developers working with multiple processor systems. Basically any developers working in a 32-bit Windows environment where optimization of code would be of interest via multi-threaded programming would find this example program worth a look.
Target Hardware & Software Platforms
Systems running Intel® Xeon® processors
Microsoft Windows* 2000 and other Win32 operating systems