Why thread specific data is required in pthread ?

Posted by user504542 on Stack Overflow See other posts from Stack Overflow or by user504542
Published on 2011-03-04T06:55:26Z Indexed on 2011/03/04 7:25 UTC
Read the original article Hit count: 107

Filed under:
|
|

Hi As i know, all the threads share memory location. For example a global variable changes in one thread will reflect in another thread. Since each thread has its own stack, the local variables that are created inside the thread is unique. In this case, why do we need to go for thread specific data mechanism?. Can't it be achieved by auto storage varibles inside the thread function ?

Kindly clarify!!!.

BR Rj

© Stack Overflow or respective owner

Related posts about c

    Related posts about linux