Pthread

From Teknologisk videncenter
Revision as of 07:33, 3 December 2020 by Heth (talk | contribs) (Releasing ressources used by a pthread)
Jump to: navigation, search

Releasing resources used by a pthread

To release the resources - memory for stack and householding - it is necessary to call either pthread_detach or pthread_join. The resources are not released when the pthread exits without one of these calls.

  • pthread_join is called by the process or another thread.
  • pthread_detach is typically called by the thread itself to release the resources when the thread terminates

Links