Re: Unsafe getLong/getLongVolatile has to read 8 bytes. It atomic / synchronized?

2023-06-09 Thread Remi Forax
If you can use Java 11, Take a look to the VarHandle API, using VarHandles is as fast as using Unsafe, but it does not crash. For an explanation of the different order modes, [ https://gee.cs.oswego.edu/dl/html/j9mm.html | https://gee.cs.oswego.edu/dl/html/j9mm.html ] Bonus answer: as far

Re: Compute in a lock free way

2022-06-04 Thread Remi Forax
> From: "Dain Ironfoot" > To: "mechanical-sympathy" > Sent: Saturday, June 4, 2022 5:11:49 PM > Subject: Re: Compute in a lock free way > Thank you so much Remi!! > I took your advice of using CAS to update both of them and came up with this > (Can't use record as still on JDK 11). > Does this

Re: Compute in a lock free way

2022-06-04 Thread Remi Forax
- Original Message - > From: "Laurynas Biveinis" > To: "mechanical-sympathy" > Sent: Saturday, June 4, 2022 11:03:28 AM > Subject: Re: Compute in a lock free way >> I am writing a class to calculate average of prices. We use it to generate >> buy/sell signal for some financial

Re: Compute in a lock free way

2022-06-04 Thread Remi Forax
> From: "Dain Ironfoot" > To: "mechanical-sympathy" > Sent: Saturday, June 4, 2022 12:53:55 AM > Subject: Compute in a lock free way > Hello, > I am writing a class to calculate average of prices. We use it to generate > buy/sell signal for some financial instruments therefore latency is

Re: Megamorphic virtual call optimization in Java

2022-02-05 Thread Remi Forax
> From: "r r" > To: "mechanical-sympathy" > Sent: Saturday, February 5, 2022 12:20:12 PM > Subject: Megamorphic virtual call optimization in Java > Hello, > we know that there are some techniques that make virtual calls not so > expensive > in JVM like Inline Cache or Polymorphic Inline Cache.

Re: Tools for understanding GPUs?

2021-03-22 Thread Remi Forax
> De: "Henri Tremblay" > À: "mechanical-sympathy" > Envoyé: Lundi 22 Mars 2021 12:17:23 > Objet: Re: Tools for understanding GPUs? > I learned playing with Aparapi ( [ https://aparapi.com/ | > https://aparapi.com/ ] > ). > It's not super complicated but you need to jump right in mechanical

Re: Best way to dynamically spin Java classes?

2020-05-01 Thread Remi Forax
act. > Anyway very cool what defineHiddenClass will enable. yes, all these features were available but only internally for the jdk, i think since jdk 7, finding a safe way to expose them take times. regards, Rémi > On Sunday, April 26, 2020 at 10:31:20 AM UTC-7, Remi Fo

Re: Best way to dynamically spin Java classes?

2020-04-26 Thread Remi Forax
Shameless plug, i've written a simple library that shows how lookup.defineHiddenClass [1] can be used to implement dynamic proxies [ https://github.com/forax/hidden_proxy | https://github.com/forax/hidden_proxy ] regards, Rémi [1] [

Re: does call site polymorphism factor in method overrides?

2019-12-30 Thread Remi Forax
> De: "Vitaly Davidovich" > À: "mechanical-sympathy" > Envoyé: Lundi 30 Décembre 2019 19:43:27 > Objet: Re: does call site polymorphism factor in method overrides? > On Mon, Dec 30, 2019 at 1:09 PM Remi Forax < [ mailto:fo...@univ-mlv.fr | > fo...@univ

Re: does call site polymorphism factor in method overrides?

2019-12-30 Thread Remi Forax
> De: "Brian Harris" > À: "mechanical-sympathy" > Envoyé: Lundi 30 Décembre 2019 17:13:38 > Objet: Re: does call site polymorphism factor in method overrides? > Good to know Vitaly! > So a poor example then. Better example is an abstract class with a method > implementation that no subtypes

Re: Exotic classes

2019-04-27 Thread Remi Forax
sing the same set of fields, grouping together the implementation of equals and hashCode alleviate this issue. > I feel like ObjectSupport is a bit nebulous and open ended and you'd > inevitably > end up needing more support methods such as a toString method. yes, toString and perhaps com

Re: Exotic classes

2019-04-26 Thread Remi Forax
> De: "Steven Stewart-Gallus" > À: "mechanical-sympathy" > Envoyé: Vendredi 26 Avril 2019 01:51:47 > Objet: Re: Exotic classes Hi Steven, thanks for spending some time on this, > 1. Why > public abstract class ObjectSupport { > public abstract boolean equals ( Object self , Object other ); >

Re: Exotic classes

2019-04-24 Thread Remi Forax
> De: "mechanical-sympathy" > À: "mechanical-sympathy" > Envoyé: Mardi 23 Avril 2019 18:23:48 > Objet: Re: Exotic classes > Replies inline > On Monday, April 22, 2019 at 12:37:19 PM UTC-7, Remi Forax wrote: >>> De: "mechanic

Re: Exotic classes

2019-02-06 Thread Remi Forax
Hi Steven, > De: "Steven Stewart-Gallus" > À: "mechanical-sympathy" > Envoyé: Samedi 19 Janvier 2019 05:19:06 > Objet: Re: Exotic classes > On Friday, January 18, 2019 at 5:37:58 AM UTC-8, Rémi Forax wrote >>> no, CHA only works on class, not on interface. > You're probably know better than

Re: Exotic classes

2019-01-18 Thread Remi Forax
> De: "Steven Stewart-Gallus" > À: "mechanical-sympathy" > Envoyé: Jeudi 17 Janvier 2019 07:50:13 > Objet: Re: Exotic classes > I've been working on similar issues trying to optimise something > heavily. I made a similar class to this one (I even had a similar > API) but I found I called it

Re: jHiccup for .NET?

2018-08-29 Thread Remi Forax
> De: "Gil Tene" > À: "mechanical-sympathy" > Envoyé: Mardi 28 Août 2018 00:28:00 > Objet: Re: jHiccup for .NET? > There is [ https://github.com/HdrHistogram/HdrHistogram.NET | a great > implementation of HdrHistogram for .NET ] , which makes the rest of what > jHiccup does nearly-trivial to

Exotic classes

2018-02-26 Thread Remi Forax
Hi all, i'm preparing a talk at DevoxxFR on how to make a field value, a returned value, etc constant for any decent JITs (everything but c1), so i've bundled together several patterns i use for implementing dynamic language runtimes into an Java API https://github.com/forax/exotic I would

Re: Call site (optimizations)

2018-01-31 Thread Remi Forax
> De: "Francesco Nigro" > À: "mechanical-sympathy" > Envoyé: Mardi 30 Janvier 2018 15:13:03 > Objet: Re: Call site (optimizations) > Gil really thank you for the super detailed answer! > I'm digesting it and I've found an interesting

Re: Modern Garbage Collection (good article)

2016-12-22 Thread Remi Forax
s worrying. > Mind you, I'm not a fan nor a user of Go so I'm referring purely to their > stipulated strategy on how to evolve their GC. Rémi > On Thu, Dec 22, 2016 at 7:37 AM Remi Forax < fo...@univ-mlv.fr > wrote: >>> De: "Vitaly Davidovich" < vita...@gmail