OpenQNX :: The QNX Community Portal

Oct 12, 2008 - 05:50 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 25 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
oink
Post subject: How to get other process data ?  PostPosted: Apr 21, 2008 - 10:12 AM
Senior Member


Joined: May 16, 2006
Posts: 136

I have process with some threads and every thread has its own name:
pthread_key_t th_key;
char* th_buff = "sysinfo.main_thread";
pthread_key_create( &th_key, NULL );
pthread_setspecific( th_key, (void *)th_buff );

When I get tls data (in other process):
struct _thread_local_storage tls;
devctl( fd, DCMD_PROC_TIDSTATUS, ... );
lseek64( fd, ... )
read( fd, &tls, sizeof(struct _thread_local_storage) );

it gives me pointer to th_buff string,
but it is not within my process so I cannot read it:
(char *)tls.keydata[0]

How to read this pointer (outside owner process)?
/or how to set thread name and than get it?
 
 View user's profile Send private message  
Reply with quote Back to top
micro
Post subject: RE: How to get other process data ?  PostPosted: Apr 21, 2008 - 12:57 PM
Senior Member


Joined: Jul 22, 2004
Posts: 353

if this are different processes, the memory would be protected against another access.
So try putting your data into a shared memory object, whicht could be read
from other processes too. (shm_*)
 
 View user's profile Send private message  
Reply with quote Back to top
maschoen
Post subject: RE: How to get other process data ?  PostPosted: Apr 21, 2008 - 03:38 PM
QNX Master


Joined: Jun 25, 2003
Posts: 1099

Why not send the name instead of a pointer to the name? Micro, I think if he uses shared memory that it will defeat the purpose as he most likely will no longer be able to distinguish one thread from another, which sounds important. On top of that, the address will not be the same unless the shared memory is aligned, although an offset would be.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.