06-07-2005
We have some
rules here and this thread is violating several of them:
(3) Refrain from idle chatter that does not contribute to the knowledge base.
(5) Search the forums database with your keywords before asking.
(8) No BSD vs. Linux vs. Windows or similar threads.
Rule 3 alone is relaxed in the Unix Lounge area. The other rules apply to the entire site.
GuyWithAPen, at least read our FAQ section if you're not having luck with the search feature. There are many options avialable to you and they have been discussed dozens of times here. Summaries and links of these discussions are in our FAQ section.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the opportunituy of learning basics/intermediate jave for 600 Euro. Is this worth learning?? (4 Replies)
Discussion started by: frustrated1
4 Replies
2. UNIX for Dummies Questions & Answers
Hello. I am a comp sci major and am forced to take a intro to Unix class. So far i am loving it. I was wondering is it useful to learn more off on my own? Will it have any use to me when i get a job after school is done? Same applies to Perl Sed and Awk? (5 Replies)
Discussion started by: smiledk1
5 Replies
3. Shell Programming and Scripting
I have a text file called 'tomcat_temp_out'.
I want to get only last 5 minute worth of data from this file and redirect those data into another fule.
Could you please help to work on this? (2 Replies)
Discussion started by: shivanete
2 Replies
4. UNIX for Dummies Questions & Answers
So my family is cleaning out our house and my dad stumbled on a Unix system with Unigraphix installed on it, and he remembers that it was 1 of 6 computers in a set that he used at a tool and dye machine shop where he worked. He said that the computer by itself with the monitor was $20,000! I was... (8 Replies)
Discussion started by: NVOtosReborn
8 Replies
5. What is on Your Mind?
Recently while reading an linux magazine I understood that FOSS (Free or open source software) is gaining momentum.. And in my home town there is an reputed university which offers M.Sc online program on FOSS.
The course covers:
INTRODUCTION TO COMPUTING, PHILOSOPHY AND PRACTICE OF FOSS,... (4 Replies)
Discussion started by: Arun_Linux
4 Replies
6. Linux
I'm new to the Linux world and whilst I've been learning the ropes, I've read some conflicting opinions regarding the creation of separate partitions for /home and other directories during OS install.
Some say that having these directories in separate partitions allows you to reinstall without... (12 Replies)
Discussion started by: maerlyngb
12 Replies
7. Programming
Hello guys,
I have a little question.
I think about learning c or c++ because im very interessted in low Level programming. And because i love Unix Too i thought C would be the better choice since Most it Done in c. Or should i learn c++?
Because C++ has all this nice Features like oop and... (9 Replies)
Discussion started by: dryPants
9 Replies
8. What is on Your Mind?
I have just been on RedHat SA 3 training course (4 days) and sat exams EX200 (RHCSA) and EX300 (RHCE)
The daft thing was that politics meant I wasn't allowed to take courses SA 1 or 2. So I learnt about stuff I would never use (SELinux; iSCSI; NFS Kerberos encrypted with user specific access... (22 Replies)
Discussion started by: rbatte1
22 Replies
LEARN ABOUT X11R4
pthread_join
PTHREAD_JOIN(3) Linux Programmer's Manual PTHREAD_JOIN(3)
NAME
pthread_join - join with a terminated thread
SYNOPSIS
#include <pthread.h>
int pthread_join(pthread_t thread, void **retval);
Compile and link with -pthread.
DESCRIPTION
The pthread_join() function waits for the thread specified by thread to terminate. If that thread has already terminated, then
pthread_join() returns immediately. The thread specified by thread must be joinable.
If retval is not NULL, then pthread_join() copies the exit status of the target thread (i.e., the value that the target thread supplied to
pthread_exit(3)) into the location pointed to by retval. If the target thread was canceled, then PTHREAD_CANCELED is placed in the loca-
tion pointed to by retval.
If multiple threads simultaneously try to join with the same thread, the results are undefined. If the thread calling pthread_join() is
canceled, then the target thread will remain joinable (i.e., it will not be detached).
RETURN VALUE
On success, pthread_join() returns 0; on error, it returns an error number.
ERRORS
EDEADLK
A deadlock was detected (e.g., two threads tried to join with each other); or thread specifies the calling thread.
EINVAL thread is not a joinable thread.
EINVAL Another thread is already waiting to join with this thread.
ESRCH No thread with the ID thread could be found.
ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).
+---------------+---------------+---------+
|Interface | Attribute | Value |
+---------------+---------------+---------+
|pthread_join() | Thread safety | MT-Safe |
+---------------+---------------+---------+
CONFORMING TO
POSIX.1-2001, POSIX.1-2008.
NOTES
After a successful call to pthread_join(), the caller is guaranteed that the target thread has terminated. The caller may then choose to
do any clean-up that is required after termination of the thread (e.g., freeing memory or other resources that were allocated to the target
thread).
Joining with a thread that has previously been joined results in undefined behavior.
Failure to join with a thread that is joinable (i.e., one that is not detached), produces a "zombie thread". Avoid doing this, since each
zombie thread consumes some system resources, and when enough zombie threads have accumulated, it will no longer be possible to create new
threads (or processes).
There is no pthreads analog of waitpid(-1, &status, 0), that is, "join with any terminated thread". If you believe you need this function-
ality, you probably need to rethink your application design.
All of the threads in a process are peers: any thread can join with any other thread in the process.
EXAMPLE
See pthread_create(3).
SEE ALSO
pthread_cancel(3), pthread_create(3), pthread_detach(3), pthread_exit(3), pthread_tryjoin_np(3), pthreads(7)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
Linux 2017-09-15 PTHREAD_JOIN(3)