pgsql: On Windows, syslogger runs in two threads.

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: On Windows, syslogger runs in two threads.
Date: 2010-04-16 09:51:49
Message-ID: 20100416095149.BD26E7541D0@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
On Windows, syslogger runs in two threads. The main thread processes config
reload and rotation signals, and a helper thread reads messages from the
pipe and writes them to the log file. However, server code isn't generally
thread-safe, so if both try to do e.g palloc()/pfree() at the same time,
bad things will happen. To fix that, use a critical section (which is like
a mutex) to enforce that only one the threads are active at a time.

Modified Files:
--------------
pgsql/src/backend/postmaster:
syslogger.c (r1.56 -> r1.57)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/syslogger.c?r1=1.56&r2=1.57)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2010-04-16 09:51:55 pgsql: On Windows, syslogger runs in two threads.
Previous Message Heikki Linnakangas 2010-04-16 08:58:16 pgsql: In standby mode, suppress repeated LOG messages about a corrupt