Re: Threads vs Processes

Поиск
Список
Период
Сортировка
От Myron Scott
Тема Re: Threads vs Processes
Дата
Msg-id B1E52B14-EFAE-11D7-A904-00039301524A@sacadia.com
обсуждение исходный текст
Ответ на Re: Threads vs Processes  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thursday, September 25, 2003, at 10:03 AM, Tom Lane wrote:

> Shridhar Daithankar <shridhar_daithankar@persistent.co.in> writes:
>> One thing that can be done is to arrange all globals/statics in a
>> structure and make that structure thread local.
>
> That's about as far from "non-invasive" as I can imagine :-(
>
> I really, really want to avoid doing anything like the above, because 
> it
> would force us to expose to the whole backend many data structures and
> state variables that are currently local to individual .c files.  That
> complicates understanding and debugging tremendously, not to mention
> slowing the edit/compile/debug cycle when you are changing such
> structures.


Another option would be to create thread local hashtable or other lookup
structure to which you would register a structure for a particular .c 
file
or group of files.

You could then define the structures you need locally without affecting other parts of the codebase.



Myron Scott



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Threads vs Processes
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: ctid matching behavior changed?