getting particular thread cpu time

Daniel Eischen deischen at
Wed Feb 1 11:34:31 PST 2006

On Wed, 1 Feb 2006, Julian Elischer wrote:

> Daniel Eischen wrote:
> >Libpthread is M:N by default, so the kernel doesn't know about
> >userland threads.
> >
> >
> though we might think about ways that we can get that information..
> maybe a way that the user thread scheduler can be asked for the info?

We don't currently maintain per-thread system and user time.
It's not just that either, there has to be some way to identify
each thread and the kernel would need that info (name, thread
id, ??) also.  You _could_ add pthread_getrusage_np(), or
something like that, to the threads libraries which would
make it visible to the application, but I hesitate to think
this information would be useful to the kernel so that ps
and top can show it.  I think ps and top should just show
the kernel entities and that's it.  I wouldn't strongly
oppose making these utilities show userland thread info
as long as it didn't impact performance.


More information about the freebsd-threads mailing list