On Sun, 2009-01-11 at 15:11 +0900, Fujii Masao wrote:
> Yes, using semaphores for the communication is also my first approach.
> The problem of this approach is that walsender cannot wait for both
> signal from backends and the response from walreceiver concurrently,
> because
> wait-for-semaphore is blocking at least. So, I use signal for the
> communication.
IIUC: In sync mode backend sends signal to walsender, then adds itself
to wait queue on semaphore. walsender responds to signal, sends more WAL
then waits for response. When response comes it then wakes backends on
the semaphore. In async mode, no signal is sent and we do not wait, we
just allow the walsender to wake up periodically and send.
Does it release waiters as soon as possible, or does it always respond
to new requests for sending? i.e. which has priority - responding to
waiters who need to be woken or responding to new requests to send?
-- Simon Riggs www.2ndQuadrant.comPostgreSQL Training, Services and Support