> You can use a lock but held in a regular CPU register. They're just regular variables for the most part.
I don't understand this. If your lock variable is in a CPU register how do other CPUs acquire the lock?
> Lock free in Java is usually worse that what the JVM can pull off with lock elision
I don't understand this either. Java's lock elision is only going to make a concurrent object 'lock-free' in the case where the object does not escape the compilation unit. In which case again how would another thread use it? Java will also combine adjacent critical sections created by monitors even if they escape, but it won't make them lock-free in that case.
I work with the JVM at Oracle and I’ve given talks about the lock elision algorithm. It doesn’t do what you think it does and what it does do is not related to lock-free like you think it is.
I don't understand this. If your lock variable is in a CPU register how do other CPUs acquire the lock?
> Lock free in Java is usually worse that what the JVM can pull off with lock elision
I don't understand this either. Java's lock elision is only going to make a concurrent object 'lock-free' in the case where the object does not escape the compilation unit. In which case again how would another thread use it? Java will also combine adjacent critical sections created by monitors even if they escape, but it won't make them lock-free in that case.