03-21-2005
Where are the pthread functions??
When I use some of the pthread functions: pthread_join, pthread_exit they work perfect. But when I look in the pthread.h file I can't seem to find any implementations of the functions...where are they hiding??
10 More Discussions You Might Find Interesting
1. Programming
Can someone point to a link where I can get good info about pthread?
thanx.. :) (1 Reply)
Discussion started by: jyotipg
1 Replies
2. Programming
consider if the thread routine returns any void pointer while calling pthread_join,
the thread resources are freed and the thread will be terminated when the main thread is exit ,that is my assumption whether it is true
how do we find whether the thread is alive or terminated
how do we find... (0 Replies)
Discussion started by: MKSRaja
0 Replies
3. Programming
hallo 2 al
can anyone pls tell me where and how can i find and install the pthread.h lib ?
thx :cool: (2 Replies)
Discussion started by: XinU*
2 Replies
4. Programming
I would like to make my own implementations of some of the pthread functions (pthread_exit(), pthread_join() etc.).
Does someone have any idea on how to get started doing this?? (1 Reply)
Discussion started by: bigblop
1 Replies
5. Solaris
Hi all!
I am working on unix systems.I am programming in c.
I have got some problems with pthread.when I use pthread_create to creat a thread it says:
(.text+0x3a): undefined reference to `pthread_create'.
same is the problm with pthread_kill.
Can anyone help me out here.
Thanks.
vij. (2 Replies)
Discussion started by: vijlak
2 Replies
6. Programming
problem solved
edited, sorry (1 Reply)
Discussion started by: joey
1 Replies
7. Programming
Hi all,
How can i parallize this code in pthread?
for(round=1;round<=16;round++)
{
Expansion(mid, 17 - round - 1, left);
Expansion(mid, round - 1, right);
round++;
Expansion(right, 17 - round - 1, mid);
Expansion(left, round - 1,mid);
}
Whereby each loop depend on the... (2 Replies)
Discussion started by: m_enayah
2 Replies
8. UNIX for Advanced & Expert Users
I am so confused about the user threads and kernel threads.Suppose I created a thread using pthread create call in Linux ,whether it will be a user thread or kernel thread.If it user thread,then how its map to kernel thread.
I heard about the M:1,M:N,1:1 mapping methods.Which method linux is... (1 Reply)
Discussion started by: sujith4u87
1 Replies
9. Programming
I have a while loop like so:
while (counter (file1));
how can I pass that into a pthread_create()?
I was thinking ...
while(pthread_create(&path, NULL, counter, file));
is that right? (1 Reply)
Discussion started by: l flipboi l
1 Replies
10. Shell Programming and Scripting
I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line
if
then... (8 Replies)
Discussion started by: saku
8 Replies
LEARN ABOUT REDHAT
pthread_join
PTHREAD_JOIN(3) Library Functions Manual PTHREAD_JOIN(3)
NAME
pthread_join - wait for termination of another thread
SYNOPSIS
#include <pthread.h>
int pthread_join(pthread_t th, void **thread_return);
DESCRIPTION
pthread_join suspends the execution of the calling thread until the thread identified by th terminates, either by calling pthread_exit(3)
or by being cancelled.
If thread_return is not NULL, the return value of th is stored in the location pointed to by thread_return. The return value of th is
either the argument it gave to pthread_exit(3), or PTHREAD_CANCELED if th was cancelled.
The joined thread th must be in the joinable state: it must not have been detached using pthread_detach(3) or the PTHREAD_CREATE_DETACHED
attribute to pthread_create(3).
When a joinable thread terminates, its memory resources (thread descriptor and stack) are not deallocated until another thread performs
pthread_join on it. Therefore, pthread_join must be called once for each joinable thread created to avoid memory leaks.
At most one thread can wait for the termination of a given thread. Calling pthread_join on a thread th on which another thread is already
waiting for termination returns an error.
CANCELLATION
pthread_join is a cancellation point. If a thread is canceled while suspended in pthread_join, the thread execution resumes immediately and
the cancellation is executed without waiting for the th thread to terminate. If cancellation occurs during pthread_join, the th thread
remains not joined.
RETURN VALUE
On success, the return value of th is stored in the location pointed to by thread_return, and 0 is returned. On error, a non-zero error
code is returned.
ERRORS
ESRCH No thread could be found corresponding to that specified by th.
EINVAL The th thread has been detached.
EINVAL Another thread is already waiting on termination of th.
EDEADLK
The th argument refers to the calling thread.
AUTHOR
Xavier Leroy <Xavier.Leroy@inria.fr>
SEE ALSO
pthread_exit(3), pthread_detach(3), pthread_create(3), pthread_attr_setdetachstate(3), pthread_cleanup_push(3), pthread_key_create(3).
LinuxThreads PTHREAD_JOIN(3)