03-22-2005
the functions are never in any of the header files. no sense in including code in the include files!
all functions are in the libraries and i doubt if you will get source for any OS except those that are open source.
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 SUSE
pthread_exit
PTHREAD_EXIT(3) Linux Programmer's Manual PTHREAD_EXIT(3)
NAME
pthread_exit - terminate calling thread
SYNOPSIS
#include <pthread.h>
void pthread_exit(void *retval);
Compile and link with -pthread.
DESCRIPTION
The pthread_exit() function terminates the calling thread and returns a value via retval that (if the thread is joinable) is available to
another thread in the same process that calls pthread_join(3).
Any clean-up handlers established by pthread_cleanup_push(3) that have not yet been popped, are popped (in the reverse of the order in
which they were pushed) and executed. If the thread has any thread-specific data, then, after the clean-up handlers have been executed,
the corresponding destructor functions are called, in an unspecified order.
When a thread terminates, process-shared resources (e.g., mutexes, condition variables, semaphores, and file descriptors) are not released,
and functions registered using atexit(3) are not called.
After the last thread in a process terminates, the process terminates as by calling exit(3) with an exit status of zero; thus, process-
shared resources are released and functions registered using atexit(3) are called.
RETURN VALUE
This function does not return to the caller.
ERRORS
This function always succeeds.
CONFORMING TO
POSIX.1-2001.
NOTES
Performing a return from the start function of any thread other than the main thread results in an implicit call to pthread_exit(), using
the function's return value as the thread's exit status.
To allow other threads to continue execution, the main thread should terminate by calling pthread_exit() rather than exit(3).
The value pointed to by retval should not be located on the calling thread's stack, since the contents of that stack are undefined after
the thread terminates.
BUGS
Currently, there are limitations in the kernel implementation logic for wait(2)ing on a stopped thread group with a dead thread group
leader. This can manifest in problems such as a locked terminal if a stop signal is sent to a foreground process whose thread group leader
has already called pthread_exit(3).
SEE ALSO
pthread_create(3), pthread_join(3), pthreads(7)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2009-03-30 PTHREAD_EXIT(3)