Re: Parallel threads in query

Поиск
Список
Период
Сортировка
От Darafei "Komяpa" Praliaskouski
Тема Re: Parallel threads in query
Дата
Msg-id CAC8Q8tKAvMKxDzvSNV_xBrjsxo8_Er-waYyFQUqsc3V40_pvbg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Parallel threads in query  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Parallel threads in query  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Список pgsql-hackers
In theory, simulating such global limit should be possible using a bit
of shared memory for the current total, per-process counter and probably
some simple abort handling (say, just like contrib/openssl does using
ResourceOwner).

I would expect that this limit is already available and it's parallel worker limit. Basically, when start a new thread I would like to somehow consume a part of parallel worker limit - a thread is a kind of parallel worker, from user's perspective. If I have 4 cores and Postgres already started 4 parallel workers, I don't really want to start 4 threads for each of them, or 4 for one of them and 1 for each of the rest, if I manage that separately from parallel worker limit.

IPC and co - that's another question and out of scope for this one. Since OpenMP allows to write multithreaded code by just adding more #pragma around loops, I don't want to reinvent that part of infrastructure.
--
Darafei Praliaskouski
Support me: http://patreon.com/komzpa

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Parallel threads in query
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: Parallel threads in query