PAPI_get_thr_specific - Online Linux Manual Page
Section : 3
Updated : September, 2004
Source : PAPI Programmer's Reference
Note : PAPI
 
NAMEPAPI_get_thr_specific, PAPI_set_thr_specific − Store or retrieve a pointer to a thread specific data structure 
SYNOPSIS#include <papi.h>
int PAPI_get_thr_specific(int tag, void **ptr);
int PAPI_set_thr_specific(int tag, void *ptr);
DESCRIPTIONIn C, PAPI_set_thr_specific will save ptr into an array indexed by tag. PAPI_get_thr_specific will retrieve the pointer from the array with index tag. There are 2 user available locations and 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 are no  Fortran equivalent functions. 
ARGUMENTStag --  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. ptr --  A pointer to the memory containing the data structure. 
RETURN VALUESOn success, this function returns  PAPI_OK. 
 On error, a negative error value is returned. 
ERRORSPAPI_EINVAL"   The  tag  argument is out of range. 
EXAMPLE   HighLevelInfo *state = NULL;
   if (retval = PAPI_thread_init(pthread_self) != PAPI_OK)
      handle_error(retval);
   /*
    * Do we have the thread specific data setup yet?
    */
   if ((retval = PAPI_get_thr_specific(PAPI_USR1_TLS, (void *) &state))
       != PAPI_OK || state == NULL) {
      state = (HighLevelInfo *) malloc(sizeof(HighLevelInfo));
      if (state == NULL)
         return (PAPI_ESYS);
      memset(state, 0, sizeof(HighLevelInfo));
      state->EventSet = PAPI_NULL;
      if ((retval = PAPI_create_eventset(&state->EventSet)) != PAPI_OK)
         return (PAPI_ESYS);
      if ((retval=PAPI_set_thr_specific(PAPI_USR1_TLS, state))!=PAPI_OK)
         return (retval);
   }
BUGSThere are no known bugs in these functions. 
SEE ALSOPAPI_thread_init(3),.BRPAPI_thread_id(3),  PAPI_register_thread(3)"  0  
   Johanes Gumabo   
 Data Size    :    7,470 byte 
man-PAPI_get_thr_specific.3Build    :     2025-03-22, 13:26     :     
Visitor Screen    :      x   
Visitor Counter  (  page  /  site  )     :     71  /  3,976,070  
Visitor ID    :        :     
Visitor IP    :     216.73.216.52     :     
Visitor Provider    :     AMAZON-02     :     
Provider Position  (  lat  x  lon  )     :     39.962500   x   -83.006100     :      x   
Provider Accuracy Radius  (  km  )     :     20     :     
Provider City    :     Columbus     :     
Provider Province    :     Ohio  ,     :     ,  
Provider Country    :     United States     :     
Provider Continent    :     North America     :     
Visitor Recorder    :    Version    :     
Visitor Recorder    :    Library    :     
Online Linux Manual Page    :    Version    :     Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 25.03.22  
Online Linux Manual Page    :    Library    :     lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40  
Online Linux Manual Page    :    Library    :     lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40  
Data Base    :    Version    :     Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38  
Data Base    :    Library    :     lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36  
  
 
    
  If error, please print screen and send to johanes_gumabo@yahoo.co.id
 Under development. Support me via PayPal.