Re: multi-threaded pgbench
| От | Andrew Dunstan |
|---|---|
| Тема | Re: multi-threaded pgbench |
| Дата | |
| Msg-id | 4A54C194.9000406@dunslane.net обсуждение исходный текст |
| Ответ на | Re: multi-threaded pgbench (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>) |
| Ответы |
Re: multi-threaded pgbench
Re: multi-threaded pgbench |
| Список | pgsql-hackers |
Heikki Linnakangas wrote: > Alvaro Herrera wrote: > >> Itagaki Takahiro wrote: >> >> >>> Is it acceptable to use pthread in contrib module? >>> >> We don't have a precedent it seems. I think the requirement would be >> that it should compile if pthread support is not present. >> > > My thoughts as well. But I wonder, would it be harder or easier to use > fork() instead? > > I have just been down this road to some extent with parallel pg_restore, which uses threads on Windows. That might be useful as a bit of a template. Extending it to use pthreads would probably be fairly trivial. The thread/fork specific stuff ended up being fairly isolated for pg_restore. see src/bin/pg_dump/pg_backup_archiver.c:spawn_restore() I think you should have it use pthreads if available, or Windows threads there, or fork() elsewhere. cheers andrew
В списке pgsql-hackers по дате отправления: