Re: Spinlock performance improvement proposal

Поиск
Список
Период
Сортировка
От Doug McNaught
Тема Re: Spinlock performance improvement proposal
Дата
Msg-id m3y9n11sr3.fsf@belphigor.mcnaught.org
обсуждение исходный текст
Ответ на Re: Spinlock performance improvement proposal  ("D. Hageman" <dhageman@dracken.com>)
Ответы Re: Spinlock performance improvement proposal
Re: Spinlock performance improvement proposal
Список pgsql-hackers
"D. Hageman" <dhageman@dracken.com> writes:

> Save for the fact that the kernel can switch between threads faster then 
> it can switch processes considering threads share the same address space, 
> stack, code, etc.  If need be sharing the data between threads is much 
> easier then sharing between processes. 

This depends on your system.  Solaris has a huge difference between
thread and process context switch times, whereas Linux has very little 
difference (and in fact a Linux process context switch is about as
fast as a Solaris thread switch on the same hardware--Solaris is just
a pig when it comes to process context switching). 

> I can't comment on the "isolate data" line.  I am still trying to figure 
> that one out.

I think his point is one of clarity and maintainability.  When a
task's data is explicitly shared (via shared memory of some sort) it's
fairly clear when you're accessing shared data and need to worry about
locking.  Whereas when all data is shared by default (as with threads)
it's very easy to miss places where threads can step on each other.

-Doug
-- 
In a world of steel-eyed death, and men who are fighting to be warm,
Come in, she said, I'll give you shelter from the storm.    -Dylan


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

Предыдущее
От: Martín Marqués
Дата:
Сообщение: pg_dump bug
Следующее
От: "D. Hageman"
Дата:
Сообщение: Re: Spinlock performance improvement proposal