Re: condvar performance in .59 vs .60
Ulrich Drepper <[email protected]> Thu, 02 Oct 2003 16:01:54 -0700
| Newsgroups | gmane.comp.lib.phil |
|---|---|
| Organization | Red Hat, Inc. |
| Message-ID | <[email protected]> |
Jamie Lokier wrote: > Would a synchronous wakeup help? Synchronous wakeup means that the > woken task doesn't preempt the waker, as it is assumed the waker will > sleep soon. I'm not sure if this example is appropriate for a > synchronous wakeup, but the mechanism is there in the kernel if it's useful. The best solution is to get requeue working (although two syscalls are made). Alternatively, if the woken just gets added to the runqueue but doesn't replace the waker that would be OK, too. What happens in cond_signal is that the waker releases a lock upon return which the woken thread has to get when it returns from the syscall. If the woken thread preempts the waker it'll immediately go to sleep, with two more syscalls which could be been avoided. If on SMP systems the woken thread perhaps gets scheduled on another CPU that be OK, too. Then the waker at least gets the chance to finish its work. -- --------------. ,-. 444 Castro Street Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA Red Hat `--' drepper at redhat.com `---------------------------