Difference between revisions of "Pthread"
From Teknologisk videncenter
								
												
				 (Created page with " =Links= *[https://computing.llnl.gov/tutorials/pthreads/ Tutorial on pthreads from Lawrence Livermore National Laboratory] (Good) *[https://www.yangyang.cloud/blog/2018/11/09...")  | 
				m  | 
				||
| Line 1: | Line 1: | ||
| − | + | =Releasing ressources used by a pthread=  | |
| + | To release the ressources - memory for stack and householding - it is necessary to call either [https://www.man7.org/linux/man-pages/man3/pthread_detach.3.html pthread_detach] or [https://www.man7.org/linux/man-pages/man3/pthread_join.3.html pthread_join]. The ressources are not released when the pthread exits without one of these calls.   | ||
=Links=  | =Links=  | ||
*[https://computing.llnl.gov/tutorials/pthreads/ Tutorial on pthreads from Lawrence Livermore National Laboratory] (Good)  | *[https://computing.llnl.gov/tutorials/pthreads/ Tutorial on pthreads from Lawrence Livermore National Laboratory] (Good)  | ||
*[https://www.yangyang.cloud/blog/2018/11/09/worker-pool-with-eventfd/ Pthread example: Worker poll with eventfd]  | *[https://www.yangyang.cloud/blog/2018/11/09/worker-pool-with-eventfd/ Pthread example: Worker poll with eventfd]  | ||
[[Category:C]][[Category:Linux]]  | [[Category:C]][[Category:Linux]]  | ||
Revision as of 06:28, 3 December 2020
Releasing ressources used by a pthread
To release the ressources - memory for stack and householding - it is necessary to call either pthread_detach or pthread_join. The ressources are not released when the pthread exits without one of these calls.