Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Michael Kuhlmann
Hi Uwe, you are right! It's confusing because for cases 2-4, *atomic* access is explicitly mentioned but not for case 1. I overlooked the *atomic access* in the sentence before and got confused. Thanks for the clarification! On 1/5/23 13:37, Uwe Schindler wrote: Hi, I answered on the PR on

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Uwe Schindler
Hi, I answered on the PR on github. The documentation is misleading: The copypasted snippet above is misleading, you need to read the whole statement, so an IllegalStateException can only happen for unaligned access on access modes other than get/set (so volatile or opaque reads): "I

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Michael Kuhlmann
The more I think about it, the clearer is that the first line of the Javadoc is contrary to the other lines: On 1/5/23 12:59, Michael Kuhlmann wrote: * read write access modes for all T, with the exception of access modes get and set for long and double on 32-bit platforms. So all read write

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Michael Kuhlmann
On 1/5/23 12:40, Uwe Schindler wrote: The copypasted snippet above is misleading, you need to read the whole statement, so an IllegalStateException can only happen for unaligned access on access modes other than get/set (so volatile or opaque reads): "If access is misaligned then access for

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Uwe Schindler
On Wed, 4 Jan 2023 14:37:34 GMT, Per Minborg wrote: >> Currently, `java.io.Bits` is using explicit logic to read/write various >> primitive types to/from byte arrays. Switching to the use of `VarHandle` >> access would provide better performance and less code. >> >> Also, using a standard API

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-05 Thread Raffaello Giulietti
On Wed, 4 Jan 2023 14:37:34 GMT, Per Minborg wrote: >> Currently, `java.io.Bits` is using explicit logic to read/write various >> primitive types to/from byte arrays. Switching to the use of `VarHandle` >> access would provide better performance and less code. >> >> Also, using a standard API

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-04 Thread Uwe Schindler
On Wed, 4 Jan 2023 14:37:34 GMT, Per Minborg wrote: >> Currently, `java.io.Bits` is using explicit logic to read/write various >> primitive types to/from byte arrays. Switching to the use of `VarHandle` >> access would provide better performance and less code. >> >> Also, using a standard API

Re: RFR: 8299576: Reimplement java.io.Bits using VarHandle access [v5]

2023-01-04 Thread Per Minborg
> Currently, `java.io.Bits` is using explicit logic to read/write various > primitive types to/from byte arrays. Switching to the use of `VarHandle` > access would provide better performance and less code. > > Also, using a standard API for these conversions means future `VarHandle` > improvem