On Wed, Nov 10, 2010 at 5:54 PM, Arun R Bharadwaj <[email protected]> wrote: > * Stefan Hajnoczi <[email protected]> [2010-11-10 13:45:29]: >> On Wed, Nov 10, 2010 at 1:19 PM, Arun R Bharadwaj >> <[email protected]> wrote: >> I wonder if the condition variable has a measurable performance >> overhead. We unconditionally broadcast on paiocb completion. One >> idea would be to keep a counter of waiters (should only ever be 0 or >> 1) protected by aiocb_mutex and broadcast only when there is a waiter. >> I just want to share this idea, I don't know if it's necessary to >> implement it or if it could even work without a race condition. >> > > I did not understand exactly why we are going to see a performane hit. > We will be doing a broadcast only after the aio_thread has finished > the work right? So how is this going to affect performance even if we > do a useless broadcast?
If aio_thread() broadcasts before raising the signal then POSIX aio request completion is delayed by the time it takes to broadcast. I don't know if it matters though. Stefan
