
202
CHAPTER 7 THREADS AND SCHEDULING
•Each thread has its own stack for use in function calls and other processing.
•The calling process can pass an argument (
in Figure 7–1), usually a
pointer, to a thread at creation time. This argument is actually on the thread’s
stack.
•Each thread can allocate its own Thread Local Storage (TLS) indexes and read
and set TLS values. TLS, described later, provides small data arrays to
thre
ads, and a thread can access only its own TLS array. Among other
advantages, TLS assures that threads will not modify one another’s data.
The thread argument—or, alternatively, TLS—can be used to point to an
arbitrary da ta st ...