Re: Some interesting results from tweaking spinlocks

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Some interesting results from tweaking spinlocks
Дата
Msg-id 10199.1010209932@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Some interesting results from tweaking spinlocks  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Isn't there tons more lock contention on an SMP machine.

No, one would hope not.  If you can't get the various processes to
run without much interference, you're wasting your time dealing
with multiple CPUs.

In a uniprocessor, we'll suffer from lock contention if one process
happens to lose the CPU while holding a lock, and one of the other
processes that gets to run meanwhile tries to acquire that same lock.
In SMP this gets folded down: the lock holder might not lose its CPU
at all, but some other CPU could be running a process that tries to
acquire the lock meanwhile.  It's not apparent to me why that should
increase the chance of lock contention, however.  The percentage of
a process' runtime in which it is holding a lock should be the same
either way, so the probability that another process fails to acquire
the lock when it wants shouldn't change either.  Where is the flaw
in this analysis?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Some interesting results from tweaking spinlocks
Следующее
От: Brent Verner
Дата:
Сообщение: Re: Some interesting results from tweaking spinlocks