POSIX Threads : Implementation of pthread_exit(void *)
Hi there,
I hve started learning about pthreads and their implementations. I'm wondered as we use pthread_join() to collect the return value or pthread_exit() of the thread function. Therefore, In which form the whole procedure work to collect n return the exit value.
I studied that we can use static variables or malloc function to create a string and return that to the calling function. Then in malloc case it's the caller's responsibilty to free that memory.
So, the question is in threads as we collect the return value as void *, so do we need to free that memory after the use ourselves or else what kind of mechanism is used in this whole procedure.
Thank you.
|