06-10-2010
Great... thank you John.... Now... I must only understand....
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I would like to write my own version of pthread_join and some of the other pthread function. Does some know any pages that have som examples of doing this?? (1 Reply)
Discussion started by: bigblop
1 Replies
2. UNIX for Advanced & Expert Users
We had written an application in which we create worker thread.
So the main thread will create the worker thread. After some time
the child thread(Worker thread) will call pthread_exit().
This function was written in try{} and there occured an Exception
and is handled in catch(...)... (0 Replies)
Discussion started by: platso
0 Replies
3. Linux
Hello All,
The problem i'm experiencing is with the following code:
#include <pthread.h>
#include <stdio.h>
int main(void)
{
(void) pthread_join(155555, NULL);
printf("done");
return 0;
}
I'm getting on terminal segmentation fault .
System used:... (0 Replies)
Discussion started by: crocodil
0 Replies
4. HP-UX
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies
5. UNIX for Advanced & Expert Users
Hi,
I would like to know if the call
of pthread_join( thread,&status) for a thread already created
in main function will free the memory allocated to thread after the pthread_join retruns or should I wait the
termination of main function?
Is there any need to cancel or exit the thread if I... (0 Replies)
Discussion started by: Behnaz
0 Replies
6. Programming
Main function creates Thread0 and Thread1 by using pthread_create systemcall.
In Thread0() {
we are calling pthread_exit(0) ;
}
and in Thread1() {
status= pthread_join(tid,NULL);
sprintf(ebuf,"timer6: can't join with thread0, status: %d",status);
Assert(status==0,ebuf);
}
... (4 Replies)
Discussion started by: mansa
4 Replies
7. AIX
How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
Can you please tell me the command, with which one can know the amount of space a specific directory has used.
df -k . ---> Displays, the amount of space allocated, and used for a directory.
du -k <dir name> - gives me the memory used of all the files inside <dir>
But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies
9. Programming
Hi,
I am new to multithreaded programming. When creating a thread to run a specific function, does the function need to have a pthread_exit ?
Is pthread_exit analogous to a return in a function? (3 Replies)
Discussion started by: sanjayc
3 Replies
10. UNIX for Dummies Questions & Answers
Let's say i have 20 users logged on Server. How can I know how much memory percent used each of them is using with system time in each user? (2 Replies)
Discussion started by: roy1912
2 Replies
LEARN ABOUT NETBSD
pthread_exit
PTHREAD_EXIT(3) BSD Library Functions Manual PTHREAD_EXIT(3)
NAME
pthread_exit -- terminate the calling thread
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
void
pthread_exit(void *value_ptr);
DESCRIPTION
The pthread_exit() function terminates the calling thread and makes the value value_ptr available to any successful join with the terminating
thread. Any cancellation cleanup handlers that have been pushed and are not yet popped are popped in the reverse order that they were pushed
and then executed. After all cancellation handlers have been executed, if the thread has any thread-specific data, appropriate destructor
functions are called in an unspecified order. Thread termination does not release any application visible process resources, including, but
not limited to, mutexes and file descriptors, nor does it perform any process level cleanup actions, including, but not limited to, calling
atexit() routines that may exist.
An implicit call to pthread_exit() is made when a thread other than the thread in which main() was first invoked returns from the start rou-
tine that was used to create it. The function's return value serves as the thread's exit status.
The behavior of pthread_exit() is undefined if called from a cancellation handler or destructor function that was invoked as the result of an
implicit or explicit call to pthread_exit().
After a thread has terminated, the result of access to local (auto) variables of the thread is undefined. Thus, references to local vari-
ables of the exiting thread should not be used for the pthread_exit() value_ptr parameter value.
The process will exit with an exit status of 0 after the last thread has been terminated. The behavior is as if the implementation called
exit() with a zero argument at thread termination time.
RETURN VALUES
The pthread_exit() function cannot return to its caller.
ERRORS
None.
SEE ALSO
_exit(2), exit(3), pthread_create(3), pthread_join(3)
STANDARDS
The function conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
BSD
July 9, 2010 BSD