In Linux, I could discover the number of running and blocked processes running

grep "procs_running" /proc/stat

and

grep "procs_blocked" /proc/stat

Is there a way to do it in Mac OS X? Preferably, a way which I could use in a shell script?

link|improve this question
feedback

1 Answer

up vote 0 down vote accepted

Have you thought about parsing something like:

ps -AO wqb,wqr,flags,state

this via script for your proc info? Between the workqueue threadcount, proc.h flags, and state that should be enough to grep up any snapshot statistics... Or perhaps not. Let me know!

link|improve this answer
Actually, I thought about counting the number of lines of ps aux output but I was not sure if ps aux would list all processes. Also, I do not know if it is possible to know whether a processes is blocked or running using ps... – brandizzi Dec 13 '10 at 18:35
Well, the only solution I've found was something like this... It is better explained in unix.stackexchange.com/questions/4794/… Thank you anyway! – brandizzi Dec 14 '10 at 14:57
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.