This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_exit behavior from main


On Thu, Oct 4, 2012 at 3:05 PM, Bharath Ramesh <bramesh@vt.edu> wrote:

> The manpage states "To allow other threads
> to continue execution, the main thread should terminate by
> calling pthread_exit() rather than exit(3)". Does this imply that
> main's stack will be valid till all the threads exit?

No. From "man pthread_exit":

  After a thread has terminated, the result of access to local (auto)
  variables of the thread is undefined.

-- 
Paul Pluzhnikov


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]