Hi,

I'm trying to figure out the interactions between rusage and pthreads.  Peeking 
around in the kernel (7.2) I see updates occurring in various places.  
kern_clock.c, for instance, appears to increment the memory occupancy (*rss) 
counters.  This would make it appear that every thread gets part of the count, 
but also that only the process that happens to have the CPU at that moment gets 
its count updated, even if it holds the memory.  Am I misreading this?

And the context switch counters also appear to be updated per-thread, but in 
mi_switch(), in kern_synch.c.  Is this true?

If the answer is "yes, it's per-thread", then how does a process report its 
usages without putting the requisite code in each thread, along with the 
machinery to divert from whatever the thread is doing (even waiting on I/O) to 
get the report at (nearly) the same time in all threads?

Is there a big design hole here?

    Mark Terribile


      
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to