Re: PATCH: pgbench - merging transaction logs

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: pgbench - merging transaction logs
Date: 2015-03-21 19:52:08
Message-ID: alpine.DEB.2.10.1503212044330.14445@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Flower 2015-03-21 19:56:18 Re: Remove fsync ON/OFF as a visible option?
Previous Message Joshua D. Drake 2015-03-21 19:48:13 Re: Remove fsync ON/OFF as a visible option?