Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger [v2]

2022-07-13 Thread Joe Darcy
On Wed, 13 Jul 2022 15:32:18 GMT, Сергей Цыпанов wrote: >> `BigInteger.powerCache` is volatile and should be assigned only once in >> static initializer. > > Сергей Цыпанов has updated the pull request incrementally with one additional > commit since the last revision: > > 8290079: Rename lo

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger [v2]

2022-07-13 Thread Roger Riggs
On Wed, 13 Jul 2022 15:32:18 GMT, Сергей Цыпанов wrote: >> `BigInteger.powerCache` is volatile and should be assigned only once in >> static initializer. > > Сергей Цыпанов has updated the pull request incrementally with one additional > commit since the last revision: > > 8290079: Rename lo

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger [v2]

2022-07-13 Thread Сергей Цыпанов
On Wed, 13 Jul 2022 15:00:07 GMT, Roger Riggs wrote: >> Сергей Цыпанов has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8290079: Rename local var > > src/java.base/share/classes/java/math/BigInteger.java line 1276: > >> 1274: *

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger [v2]

2022-07-13 Thread Сергей Цыпанов
> `BigInteger.powerCache` is volatile and should be assigned only once in > static initializer. Сергей Цыпанов has updated the pull request incrementally with one additional commit since the last revision: 8290079: Rename local var - Changes: - all: https://git.openjdk.org/jdk

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-13 Thread Roger Riggs
On Mon, 11 Jul 2022 12:41:48 GMT, Сергей Цыпанов wrote: > `BigInteger.powerCache` is volatile and should be assigned only once in > static initializer. src/java.base/share/classes/java/math/BigInteger.java line 1276: > 1274: * on demand. > 1275: */ > 1276: BigInteger[

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-13 Thread Raffaello Giulietti
On Tue, 12 Jul 2022 21:16:23 GMT, Сергей Цыпанов wrote: >> Usually yes, but since a static initializer is executed by at most one >> thread by using a locking protocol before any other static code is ever >> executed, the runtime _could_ (but I'm not sure it it really does) treat the >> volati

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-12 Thread Сергей Цыпанов
On Tue, 12 Jul 2022 09:18:19 GMT, Raffaello Giulietti wrote: >> `BigInteger.powerCache` is volatile and should be assigned only once in >> static initializer. > > Usually yes, but since a static initializer is executed by at most one thread > by using a locking protocol before any other static

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-12 Thread Raffaello Giulietti
On Mon, 11 Jul 2022 12:41:48 GMT, Сергей Цыпанов wrote: > `BigInteger.powerCache` is volatile and should be assigned only once in > static initializer. Usually yes, but since a static initializer is executed by at most one thread by using a locking protocol before any other static code is ever

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-12 Thread Сергей Цыпанов
On Tue, 12 Jul 2022 08:35:50 GMT, Raffaello Giulietti wrote: >> `BigInteger.powerCache` is volatile and should be assigned only once in >> static initializer. > > (Not a reviewer) While the change doesn't hurt, I doubt that access to a > (static) volatile in a static initializer is ever contend

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-12 Thread Raffaello Giulietti
On Mon, 11 Jul 2022 12:41:48 GMT, Сергей Цыпанов wrote: > `BigInteger.powerCache` is volatile and should be assigned only once in > static initializer. (Not a reviewer) While the change doesn't hurt, I doubt that access to a (static) volatile in a static initializer is ever contended. ---

Re: RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-11 Thread Jaikiran Pai
On Mon, 11 Jul 2022 12:41:48 GMT, Сергей Цыпанов wrote: > `BigInteger.powerCache` is volatile and should be assigned only once in > static initializer. The change looks fine to me. Please wait for at least another review from someone more familiar with this area, before merging. -

RFR: 8290079: Reduce interaction with volatile in static initializer of BigInteger

2022-07-11 Thread Сергей Цыпанов
`BigInteger.powerCache` is volatile and should be assigned only once in static initializer. - Commit messages: - 8290079: Reduce interaction with volatile in static initializer of BigInteger Changes: https://git.openjdk.org/jdk/pull/9451/files Webrev: https://webrevs.openjdk.org/?