[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Poor condvar performance

Hash: SHA1

Luke Elliott wrote:

> Ah, I am using pshared cond vars (hence why I needed the recent fix).
> What is the plan for putting back the requeue for pshared? (I'm happy to
> stay with the futex / sched hack for now, but as a matter of interest).

Requeue cannot work with pshared.  requeue needs the virtual address of
the mutex but this cannot be determined when using pshared since it
might be different in different processes.  It would be necessary to
have a process-local part of the condvar structure to remember the mutex
address for each process separately.  There is no such functionality
which is sufficiently fast.

> Incidentally, using cond_signal() I see around 300000 content switches /
> sec and with broadcast, 200000 / sec.

That's expected.  If you know you have at most one waiter, it is always
better to use cond_broadcast.  That's a consequence of the way condvars
are implemented.  For LinuxThreads and probably other implementations
this definitely isn't the case.  I.e., everybody has to decide for
herself whether it is ok or not.

- -- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
Version: GnuPG v1.2.3 (GNU/Linux)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]