06-10-2010
My bad - that #define works for __VOID, but not for int. If you change your "int *nm = __INT(ret);" to "int *nm = (int*)ret;", you should get the right result.
Sorry for any confusion.
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 CENTOS
papi_set_multiplex
PAPI_set_multiplex(3) PAPI PAPI_set_multiplex(3)
NAME
PAPI_set_multiplex -
Convert a standard event set to a multiplexed event set.
SYNOPSIS
Detailed Description
C Interface:
#include <papi.h>
int PAPI_set_multiplex( int EventSet );
Parameters:
EventSet an integer handle for a PAPI event set as created by PAPI_create_eventset
Return values:
PAPI_OK
PAPI_EINVAL -- One or more of the arguments is invalid, or the EventSet is already multiplexed.
PAPI_ENOCMP -- The EventSet specified is not yet bound to a component.
PAPI_ENOEVST -- The EventSet specified does not exist.
PAPI_EISRUN -- The EventSet is currently counting events.
PAPI_ENOMEM -- Insufficient memory to complete the operation.
PAPI_set_multiplex converts a standard PAPI event set created by a call to PAPI_create_eventset into an event set capable of handling
multiplexed events. This must be done after calling PAPI_multiplex_init, and either PAPI_add_event or PAPI_assign_eventset_component, but
prior to calling PAPI_start().
Events can be added to an event set either before or after converting it into a multiplexed set, but the conversion must be done prior to
using it as a multiplexed set.
Note:
Multiplexing can't be enabled until PAPI knows which component is targeted. Due to the late binding nature of PAPI event sets, this
only happens after adding an event to an event set or explicitly binding the component with a call to PAPI_assign_eventset_component.
Example:
* int EventSet = PAPI_NULL;
* int ret;
*
* // Create an empty EventSet
* ret = PAPI_create_eventset(&EventSet);
* if (ret != PAPI_OK) handle_error(ret);
*
* // Bind it to the CPU component
* ret = PAPI_assign_eventset_component(EventSet, 0);
* if (ret != PAPI_OK) handle_error(ret);
*
* // Check current multiplex status
* ret = PAPI_get_multiplex(EventSet);
* if (ret == TRUE) printf("This event set is ready for multiplexing.")
* if (ret == FALSE) printf("This event set is not enabled for multiplexing.")
* if (ret < 0) handle_error(ret);
*
* // Turn on multiplexing
* ret = PAPI_set_multiplex(EventSet);
* if ((ret == PAPI_EINVAL) && (PAPI_get_multiplex(EventSet) == TRUE))
* printf("This event set already has multiplexing enabled0);
* else if (ret != PAPI_OK) handle_error(ret);
*
See Also:
PAPI_multiplex_init
PAPI_get_multiplex
PAPI_set_opt
PAPI_create_eventset
Author
Generated automatically by Doxygen for PAPI from the source code.
Version 5.2.0.0 Tue Jun 17 2014 PAPI_set_multiplex(3)