In posix library, if we create a thread in main function, then it is in joinable state.
- What are this 3 modes, joinable, joined, detached?
- Is it recommended to use pthread_join or pthread_detach?
- What if the thread is not joined or detached? How the resources are deallocated in this mode?
- What happens if pthread_exit is called from main thread for each of 3 modes?
By joinable, i mean that without using pthread_join or pthread_detach i.e. default mode after creating thread.
- Why pthread_join is named like this, why not simply pthread_wait?
Consider linux implementation of threads.