Re: PATCH: pgbench - merging transaction logs

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: PATCH: pgbench - merging transaction logs
Дата
Msg-id alpine.DEB.2.10.1503212044330.14445@sto
обсуждение исходный текст
Ответ на Re: PATCH: pgbench - merging transaction logs  (Andres Freund <andres@2ndquadrant.com>)
Список pgsql-hackers
> Well, fprintf() doesn't have to acquire the lock for the entirety of
> it's operation - just for the access to the stream buffer.

Yep. If it is implemented by appending stuff to the stream as the format 
is processed, this would still mean the whole time of its operation.

Hence preprocessing the string as you suggested may be desirable.

> Note that posix 2001 *does* guarantee that FILE* style IO is thread
> safe:
> "All functions that reference (FILE *) objects, except those with names
> ending in _unlocked, shall behave as if they use flockfile() and
> funlockfile() internally to obtain ownership of these (FILE *) objects."
>
> Hilariously that tidbit hidden in the documentation about
> flockfile. Very, err, easy to find:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/flockfile.html

Thanks for the pointer!

-- 
Fabien.



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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Remove fsync ON/OFF as a visible option?
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Remove fsync ON/OFF as a visible option?