Lambda the Ultimate

inactiveTopic Double Check Locking In Java
started 5/30/2001; 1:03:40 AM - last post 5/31/2001; 8:03:20 AM
Chris Rathman - Double Check Locking In Java  blueArrow
5/30/2001; 1:03:40 AM (reads: 1408, responses: 2)
Double Check Locking In Java
This article discusses some of the difficulties involved in trying to use double check locking as the method to avoid race conditions between threads. The conclusion is that DCL is broken in the Java Memory model.

As long as we're on the subject of threads, the biggest problem that I see with their use in Java (and a number of other languages)is that they only support a cooperative model of threading. Java essentially gave up on controlling threads by any means other than cooperation when they deprecated the suspend(), resume(), and stop() methods. That means that all threads must be aware of possible conflicts with all other threads - now and into the future - making for a large amount of coupling between code and breaking any form of encapsulation.

While on the subject of Java, Parsing With JavaCC might be of interest to those that like to write their own grammer.
Posted to OOP by Chris Rathman on 5/30/01; 1:04:39 AM

andrew cooke - Re: Double Check Locking In Java  blueArrow
5/30/2001; 4:59:35 AM (reads: 901, responses: 0)
If people are interested in JavaCC, they might also like SableCC - when I looked at this (years ago now) I was impressed by SableCC's structure (I thought the design was more elegant). Some comments on my experience using it are here.

John Lawter - Re: Double Check Locking In Java  blueArrow
5/31/2001; 8:03:20 AM (reads: 899, responses: 0)
While on the subject of Java threading and the JMM, here's a link to a Java Community Process spec for revising the threading and memory model.