Re: [GENERAL] BufferSync() performance

2009-03-05 Thread Greg Smith
On Thu, 5 Mar 2009, Guido Ostkamp wrote: Would this work or is there a special reason why the original check was done with lock held? http://en.wikipedia.org/wiki/Race_condition Until you have a lock on a buffer header, you can't trust that you're even seeing consistent information about it.

Re: [GENERAL] BufferSync() performance

2009-03-05 Thread Tom Lane
Guido Ostkamp writes: > Would this work or is there a special reason why the original check was > done with lock held? This will fail, very nastily, on multiple-CPU machines with weak memory ordering guarantees. You can't assume you are seeing an up-to-date value of the flag bit if you don't ta

[GENERAL] BufferSync() performance

2009-03-05 Thread Guido Ostkamp
Hello, Bruce Momjian is with us for some training sessions this week and has asked me to post the following question to the mailing list (I have chosen this list as it was suggested not to post directly to hackers list): When looking at function BufferSync() in postgresql/src/backend/storage