Each process in Mac OS X is made up of one or more threads. A thread is a stream of execution that runs code for the process. You can improve application performance and enhance the perceived responsiveness of the user interface when you set up your application to use multiple threads. On computers with one processor, multithreading can allow a program to execute multiple pieces of code independently. On computers with more than one processor, multithreading can allow a program to execute multiple pieces of code simultaneously.
Multithreading, however, is not the solution for all performance issues. When it is a possible solution, it enhances performance only when it's set up correctly. Getting multithreading to work properly in an OpenGL application requires advanced programming techniques—the OpenGL API is not inherently thread-safe. If you want to make your OpenGL program multithreaded, read this chapter to get started, then roll up your sleeves. Be prepared to undertake a lot of detective work if things go wrong. In threaded applications, the cause of the problem is often difficult to isolate.
Program Design
Guidelines for Threading OpenGL Applications
When Things Go Wrong
Threading APIs
See Also
Last updated: 2008-06-09