Jason Cooper <[EMAIL PROTECTED]> writes:

> Sorry for the OT post, however, I'm unable to locate the subscibe info
> for the lkml c-programming ml.  Hopefully there is at least one person
> who can help me with this simple problem.  It's not critical, but would
> help with debugging.
>
> I'm writing a project in C on a Gentoo box.  I'm using pthreads for the 
> first time, and so far, it's working well.  There are 8 threads who stay 
> alive for the duration of execution.  When I'm hitting it with a heavy 
> load, I'd like to see which thread it struggling (with top, ps, etc).  
> Unfortunately, They all inherit the name of the executable.
>
> Does any one know how to change the name of the thread identifier used
> in top?  I've dug through the oreilly book on pthreads, the man pages,
> the net, etc.  No luck.  I probably just don't know the correct name of
> the "identifier" attribute variable.  :(  It should be in the attributes 
> somewhere.  Unfortunately, the structure doesn't appear to be defined 
> in pthread.h .  There doesn't appear to be a pthread_attr_[get|set]*()
> functions that would fit the bill.

[...]

int main(int argc, char *argv[]) ...

Try changing the value of argv[0] in each thread.

Matt


-- 
Matthew Kennedy
Gentoo Linux Developer
Bugs go to http://bugs.gentoo.org!


--
[EMAIL PROTECTED] mailing list

Reply via email to