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)
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)
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)
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)
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)
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)
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)
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)
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 CENTOS
papi_get_thr_specific
PAPI_get_thr_specific(3) PAPI PAPI_get_thr_specific(3)NAME
PAPI_get_thr_specific -
Retrieve a pointer to a thread specific data structure.
SYNOPSIS Detailed Description
@par Prototype:
int PAPI_get_thr_specific( int tag, void **ptr );
@param tag
An identifier, the value of which is either PAPI_USR1_TLS or
PAPI_USR2_TLS. This identifier indicates which of several data
structures associated with this thread is to be accessed.
@param ptr
A pointer to the memory containing the data structure.
@retval PAPI_OK
@retval PAPI_EINVAL
The @em tag argument is out of range.
In C, PAPI_get_thr_specific PAPI_get_thr_specific will retrieve the pointer from the array with index @em tag.
There are 2 user available locations and @em tag can be either
PAPI_USR1_TLS or PAPI_USR2_TLS.
The array mentioned above is managed by PAPI and allocated to each
thread which has called PAPI_thread_init.
There is no Fortran equivalent function.
@par Example:
int ret;
HighLevelInfo *state = NULL;
ret = PAPI_thread_init(pthread_self);
if (ret != PAPI_OK) handle_error(ret);
// Do we have the thread specific data setup yet?
ret = PAPI_get_thr_specific(PAPI_USR1_TLS, (void *) &state);
if (ret != PAPI_OK || state == NULL) {
state = (HighLevelInfo *) malloc(sizeof(HighLevelInfo));
if (state == NULL) return (PAPI_ESYS);
memset(state, 0, sizeof(HighLevelInfo));
state->EventSet = PAPI_NULL;
ret = PAPI_create_eventset(&state->EventSet);
if (ret != PAPI_OK) return (PAPI_ESYS);
ret = PAPI_set_thr_specific(PAPI_USR1_TLS, state);
if (ret != PAPI_OK) return (ret);
}
*
See Also:
PAPI_register_thread PAPI_thread_init PAPI_thread_id PAPI_set_thr_specific
Author
Generated automatically by Doxygen for PAPI from the source code.
Version 5.2.0.0 Tue Jun 17 2014 PAPI_get_thr_specific(3)