Re: Strange Windows problem, lock_timeout test request - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Strange Windows problem, lock_timeout test request
Date
Msg-id 4639.1363615746@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strange Windows problem, lock_timeout test request  (Boszormenyi Zoltan <zb@cybertec.at>)
Responses Re: Strange Windows problem, lock_timeout test request  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Boszormenyi Zoltan <zb@cybertec.at> writes:
> How about the attached patch over current GIT? In other words,
> why I am wrong with this idea?

Because it's wrong.  Removing "volatile" means that the compiler is
permitted to optimize away stores (and fetches!) on the basis of their
being unnecessary according to straight-line analysis of the code.
Write barriers don't fix that, they only say that stores that the
compiler chooses to issue at all have to be ordered a certain way.

(There are also pretty serious questions as to whether pg_write_barrier
can be trusted yet, but it doesn't really matter here.  Removing
volatile would break the code.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Enabling Checksums
Next
From: Dimitri Fontaine
Date:
Subject: Re: in-catalog Extension Scripts and Control parameters (templates?)