Java closures and threading
My main concern with proposals for closures in Java has always been that it has the potential of making multi-threading so transparent that you forget to think about issues you need to think about, much like happens again and again with mechanisms that make it so transparent to make remote procedure calls that you forget to handle the issues you really need to think about in that scenario.
Rather than write a long story here, I wrote my first blog post ever: http://tobega.blogspot.com/2008/02/java-closures-and-threads.html
I have been writing code since 1980. In 1999, I learned Java and after discovering IntelliJ the love was complete. XML and XSLT was a revelation in 2000, too bad the standards committees have done so much damage since. Contributed to the Flying Saucer open source XML and CSS rendered and published an open source XSLT generator, weffo. Currently employed by Google. Torbjörn is a DZone MVB and is not an employee of DZone and has posted 8 posts at DZone. You can read more from them at their website.
- Login or register to post comments
- 470 reads
- Printer-friendly version
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)










Comments
Osvaldo Doederlein replied on Mon, 2008/03/03 - 3:54pm
Torbjörn Gannholm replied on Tue, 2008/03/04 - 3:00am
Osvaldo, programmers are no more stupid than anybody else as stated by Dilberts rule: "Everybody is an idiot sometimes".
It is even more likely that programmers are forgetful sometimes even if they know what they're doing.
You seem to read my post as "no closures" but that is not what I said, I merely stated that there is a weakness in BGGA where threading is concerned. But the CICE proposal has a nice solution for that, shared mutable variables have to be labelled public. The only enhancement I can think of over that would be to by default require that referenced shared objects are immutable.