47e Subj : Re: get num waiters on cv To : comp.programming.threads From : Sree Date : Mon May 02 2005 08:06 pm Joe Seigh wrote: > On Mon, 02 May 2005 18:22:02 +0530, Sree wrote: > >> Hi, >> Is there a way (like say a pthread syscall) to get the number of threads >> waiting on a cv and mutex? I wish to avoid additional bookkeeping at the >> application level(like counters) to achieve this. >> > Anything not in the pthreads api wouldn't be portable. Some > implementations > like Linux have that info in userspace if you can figure out your way > through > the opaque data types to get to it but I wouldn't trust the api to be > stable > enough that you could trust code to work accross multiple releases. And > there > is no such thing as a standard pthread syscall if you're thinking there's > anything like that. > seems strange considering the info might be kept in a straightforward fashion in the kernel data structure. This does look to me like a not-so-infrequently desired information, say for resource management or in my case, for diagnostics (to detect hopeless waiters). . 0