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

Re: Poor condvar performance



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jamie Lokier wrote:
> Why do you need to remember the mutex address in each process, if it's
> in shared memory?  Is it because the requeue operation would have to
> move a waiter from a shared memory futex to a process-local memory futex?

There need not be any relationship at all between the addresses of the
condvar and mutex in the different processes.  the cond_signal and
cond_broadcast calls don't take the mutex address as a parameter.
Therefore it is the cond_wait/cond_timedwait call which has to provide
it.  But imagine the extreme case where all waiters are in one process,
and the cond_signal caller in another.  How would the cond_signal call
know the address of the mutex in its own address space (if the mutex is
available at all, it's not necessary).

Any functionality which requires a pshared mode of operation must _not_
use pointers.  We might be able to do something with physical addresses
but I doubt the kernel people want to export that kind of knowledge.

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

iD8DBQE/xVh02ijCOnn/RHQRAq7QAJ4xDYIOnKjNoIPnI9yuTo8jAvhBEwCfY6ZW
olIUdOsnJq3kBuDFf1dESC8=
=Ty41
-----END PGP SIGNATURE-----




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