<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-37533472</id><updated>2011-12-14T21:48:02.223-05:00</updated><category term='transactional memory'/><category term='rules'/><category term='appistry'/><category term='threads'/><category term='ibm'/><category term='jcip'/><category term='desktop'/><category term='multi-threading'/><category term='java'/><category term='x10'/><category term='programming'/><category term='sun microsystems'/><category term='sun'/><category term='multithreading'/><category term='tm'/><category term='how to'/><category term='java ee'/><category term='how-to'/><category term='concurrency'/><category term='thread'/><category term='fork-join'/><category term='mapreduce'/><category term='google'/><category term='grid'/><title type='text'>concurrency and other critical software issues</title><subtitle type='html'>Writing computer programs since 1969, here's my take on some of the fine points of this art. Currently and possibly for the next decade, the most critical issue in programming is concurrency: how to have threads safely share data and optimally use the ubiquitous multicore chips. Start with this post: &lt;a href="http://multithreading.blogspot.com/2006/11/mandatory-rules-for-safe.html"&gt;Rules for safe multithreaded Java apps&lt;/a&gt;.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>29</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-37533472.post-7830799823508153666</id><published>2007-11-16T16:55:00.000-05:00</published><updated>2007-11-24T09:41:34.711-05:00</updated><title type='text'>Google Android contains j.u.c</title><content type='html'>Great news: &lt;span style="color: rgb(255, 255, 153);"&gt;Android.jar&lt;/span&gt; contains package&lt;span style="color: rgb(153, 255, 153);"&gt; java.util.concurrent&lt;/span&gt; and sub-packages &lt;span style="color: rgb(153, 255, 153);"&gt;atomic &lt;/span&gt;and &lt;span style="color: rgb(153, 255, 153);"&gt;locks&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;It also contains intriguing &lt;span style="color: rgb(153, 255, 255);"&gt;org.apache.&lt;span style="color: rgb(255, 204, 153);"&gt;http&lt;/span&gt;.util.concurrent&lt;/span&gt; containing classes &lt;span style="color: rgb(153, 255, 255);"&gt;Executor.java&lt;/span&gt; and &lt;span style="color: rgb(153, 255, 255);"&gt;ThreadFactory.java&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;It has of course many more packages. It seems to be more than Java SE, rather than something between Java ME and Java SE. It looks like Google removed a few packages from SE and added their own. For example, they have removed, awt, Swing, corba.&lt;br /&gt;&lt;br /&gt;I hope the speech recognition API works.&lt;br /&gt;&lt;br /&gt;I also hope that it has better APIs than current Java open source products for accessing peripherals. These shouldn't be too hard to beat, the JCP-issued APIs being so poor at it. Android seems to have a generic way for programs to communicate with the OS and with services running on a device, including peripherals. The Java world really needed this badly (i.e., a way to integrate with peripherals) and we have been promised this by Sun &lt;span style="font-style: italic;"&gt;et al.&lt;/span&gt; since 1996, but few were delivered. Soon we should know if Google has delivered it, by trying our Android apps in an emulator. But the final proof will be when the devices are out and the carriers/telcos are supporting them, probably in 12 months or so, if we are lucky.&lt;br /&gt;&lt;br /&gt;Will we have to move to a different country in order to be able to use some of cool apps on Android, including our own?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-7830799823508153666?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/7830799823508153666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=7830799823508153666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/7830799823508153666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/7830799823508153666'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/11/google-android-contains-juc.html' title='Google Android contains j.u.c'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-4103965989846795611</id><published>2007-08-26T13:09:00.000-04:00</published><updated>2007-10-13T14:21:11.927-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='multi-threading'/><category scheme='http://www.blogger.com/atom/ns#' term='appistry'/><category scheme='http://www.blogger.com/atom/ns#' term='sun microsystems'/><category scheme='http://www.blogger.com/atom/ns#' term='sun'/><category scheme='http://www.blogger.com/atom/ns#' term='java ee'/><category scheme='http://www.blogger.com/atom/ns#' term='tm'/><category scheme='http://www.blogger.com/atom/ns#' term='fork-join'/><category scheme='http://www.blogger.com/atom/ns#' term='grid'/><category scheme='http://www.blogger.com/atom/ns#' term='transactional memory'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><category scheme='http://www.blogger.com/atom/ns#' term='mapreduce'/><category scheme='http://www.blogger.com/atom/ns#' term='multithreading'/><category scheme='http://www.blogger.com/atom/ns#' term='x10'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='ibm'/><title type='text'>Current Approaches As Of August 2007</title><content type='html'>&lt;ol&gt;&lt;li&gt;The &lt;span style="color: rgb(255, 255, 153);"&gt;conventional&lt;/span&gt; multithreading where the programmer writes all the controls for the threads and how they share and don't share data, in the hope of optimizing resources (e.g., threads, memory, communication).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;New&lt;/span&gt; multithreading techniques, some usable, some in dev, where the programmer does not have to write all the controls for the threads and how they share and don't share data, and yet resources are still optimized.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The most promising technique is &lt;span style="color: rgb(255, 255, 153);"&gt;TM&lt;/span&gt; - not Transcendental Meditation - but &lt;span style="color: rgb(255, 255, 153);"&gt;Transactional Memory&lt;/span&gt;, where the CPU (instruction set), OS, and VM are designed to make all accesses to the RAM work somewhat like transactional access to a database.&lt;br /&gt;&lt;a href="http://www.theregister.co.uk/2007/08/21/sun_transactional_memory_rock/"&gt;Sun will be including TM in it's Rock processor due near the end of 2008&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;X10&lt;/span&gt; - an extension of Java - in development - IBM is a main contributor.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;Grid-for-Concurrency&lt;/span&gt; frameworks that allow at least some sharing of data between threads:&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;Fork-Join&lt;/span&gt; Frameworks:&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The most popular is Google's &lt;span style="color: rgb(255, 255, 153);"&gt;MapReduce&lt;/span&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;TODO - more fork-join examples&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt;The &lt;span style="color: rgb(255, 255, 153);"&gt;Appistry&lt;/span&gt; Grid where the programmer writes single-threaded logic and the underlying system takes care of managing the available resources (threads and memory).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;TODO other grid (for concurrency) examples.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;Java EE&lt;/span&gt; - A great multithreading platform, particularly the EJB containers. The extra seconds in http request processing are worth it when considering the difficulties in developing robust, mission-critical multithreaded apps and the reduction in costs that Java EE makes possible for such apps.&lt;br /&gt;&lt;br /&gt;UPDATE 2007.10.13: memory leaks occurring when using a ThreadLocal in certain situations maybe reducing Java EE's advantage for safe multithreading.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-4103965989846795611?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/4103965989846795611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=4103965989846795611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/4103965989846795611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/4103965989846795611'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/08/current-approaches-as-of-august-2007.html' title='Current Approaches As Of August 2007'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-2058926671448517593</id><published>2007-03-25T19:57:00.000-04:00</published><updated>2007-03-26T18:51:29.294-04:00</updated><title type='text'>Appistry is one way of doing it</title><content type='html'>&lt;span style="font-family:Verdana,Arial,Helvetica,sans-serif;"&gt;&lt;a href="http://www.internetnews.com/dev-news/article.php/3667651"&gt;Appistry 3.5&lt;/a&gt; &lt;/span&gt;&lt;blockquote&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt;allows Java and .NET applications to scale out across a number of servers while running as though it were one application on one server.&lt;/span&gt;&lt;span style=";font-family:Verdana,Arial,Helvetica,sans-serif;font-size:85%;"  &gt; The Fabric makes the application think it's running on one computer, and the developer writes applications as though it will run on a single computer. But in execution, the application could be distributed over 100 or more computers.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family:Verdana,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;span style=";font-family:georgia;font-size:100%;"  &gt;So we seem to have at least 4 approaches:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;The conventional multithreading where the programmer writes all the controls for the threads and how they share and don't share data, in the hope of optimizing resources  (e.g., threads, memory, communication).&lt;/li&gt;&lt;li&gt;The future multithreading yet to be usable, where the programmer does not have to write all the controls for the threads and how they share and don't share data, yet resources are still optimized.&lt;/li&gt;&lt;li&gt;The Google Grid technique called MapReduce.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The Appistry Grid technique where the programmer writes single-threaded logic and the underlying system takes care of managing the available resources (threads and memory).&lt;/li&gt;&lt;/ol&gt;The Appistry approach seems to pose difficulties for applications that require multiple threads to share data. It allows applications to launch multiple threads but probably does not offer more help for controling their interactions than what the language already offers. This remains to be verified. If it is the case, then for scaling, the programmer has to make difficult non-obvious choices between the single-thread auto-scaling by Fabric versus the conventional multithreading approach. I would think that if you have Fabric then you minimize your use of multithreading.&lt;span style="font-family:Verdana,Arial,Helvetica,sans-serif;"&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-2058926671448517593?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/2058926671448517593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=2058926671448517593' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/2058926671448517593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/2058926671448517593'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/03/appistry-is-one-way-of-doing-it.html' title='Appistry is one way of doing it'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-3575413813002991513</id><published>2007-03-25T19:50:00.000-04:00</published><updated>2007-03-25T19:53:56.971-04:00</updated><title type='text'>Gosling Agrees: The next big thing is multithreading</title><content type='html'>&lt;a href="http://news.com.com/Gosling+looks+down+Suns+open+road+-+page+3/2008-7344_3-6168505-3.html?tag=st.num"&gt;Dr James Gosling on c|net news.com, March 19, 2007&lt;/a&gt;: The next big innovation is multithreading.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;blockquote&gt;&lt;b&gt;What do you think will be the next big tech innovation that will affect enterprise IT?&lt;/b&gt;&lt;br /&gt;Gosling: There's a lot of stuff going on around multithreading--for example, the way that Moore's Law is shifting from clock rate to number of cores, which means people have to be increasingly conscious of what it means to build multithreaded applications.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-3575413813002991513?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/3575413813002991513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=3575413813002991513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/3575413813002991513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/3575413813002991513'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/03/gosling-agrees-next-big-thing-is.html' title='Gosling Agrees: The next big thing is multithreading'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-8438957114785888181</id><published>2007-03-04T17:31:00.000-05:00</published><updated>2007-03-04T19:59:40.066-05:00</updated><title type='text'>Erlang is top contender for distributed app today</title><content type='html'>&lt;a href="http://www.pragmaticprogrammer.com/titles/jaerlang/"&gt;The book on Erlang&lt;/a&gt;, by the creator of Erlang, &lt;span style="color: rgb(255, 255, 153); font-weight: bold;"&gt;Joe Armstrong&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Joe designed and implemented the first version of Erlang in 1986 and he currently works for Ericsson AB where Erlang is used to build &lt;span style="color: rgb(255, 255, 153);"&gt;highly-fault tolerant&lt;/span&gt; switching systems.&lt;br /&gt;&lt;br /&gt;The above link has links to 2 large size pdf extracts from the book. One is &lt;a href="http://media.pragprog.com/titles/jaerlang/Concurrent.pdf"&gt;http://media.pragprog.com/titles/jaerlang/Concurrent.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The web site on the open source version: &lt;a href="http://www.erlang.org/"&gt;http://www.erlang.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here's a &lt;a href="http://radar.oreilly.com/archives/2007/03/concurrent_prog_1.html"&gt;2007.03.03 blog by Tim O'Reilly on Erlang and other concurrency issues&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Tim mentions that some have found Erlang to be too "old".&lt;br /&gt;&lt;br /&gt;TODO learn Erlang&lt;br /&gt;&lt;br /&gt;Erlang is called &lt;span style="font-style: italic;"&gt;"a pure message passing language"&lt;/span&gt;. Erlang processes do not share memory. It is excellent for distributed apps but can it be considered a standard multithreaded language? I do not yet know if Erlang has threads where memory is shared.&lt;br /&gt;&lt;br /&gt;I recommend that we distinguish standard multithreaded languages where threads share memory from those where threads do not share memory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-8438957114785888181?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/8438957114785888181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=8438957114785888181' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/8438957114785888181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/8438957114785888181'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/03/erlang-may-be-best-concurrent-language.html' title='Erlang is top contender for distributed app today'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-5761217788205099296</id><published>2007-02-11T13:52:00.000-05:00</published><updated>2007-02-11T14:38:44.223-05:00</updated><title type='text'>Dave Patterson, et al., U.C., Berkely</title><content type='html'>A &lt;a href="http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-183.html"&gt;web page&lt;/a&gt; from Dec. 18, 2006: &lt;span style="font-style: italic; font-weight: bold;font-size:85%;" &gt;The Landscape of Parallel Computing Research: A View from Berkeley&lt;/span&gt; - Introduces &lt;a href="http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-183.pdf"&gt;this pdf&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;My summary of this paper (they call it white):&lt;br /&gt;• Goal = &lt;span style="color: rgb(255, 255, 153);"&gt;make it easy to write programs&lt;/span&gt; &lt;span style="font-size:85%;"&gt;(that execute efficiently on highly parallel systems).&lt;/span&gt;&lt;br /&gt;• 1000s of cores per chip.&lt;br /&gt;• For benchmarking, use &lt;span style="color: rgb(255, 255, 153);"&gt;Dwarfs &lt;/span&gt;(a dwarf is a basic class of patterns of computation and communication, a primary type of computation); this team has defined &lt;a href="http://view.eecs.berkeley.edu/wiki/Dwarf_Mine"&gt;13 dwarfs&lt;/a&gt; currently. For example, &lt;a href="http://view.eecs.berkeley.edu/wiki/MapReduce"&gt;MapReduce&lt;/a&gt; is a dwarf, &lt;a href="http://view.eecs.berkeley.edu/wiki/Spectral_Methods"&gt;Spectral Methods&lt;/a&gt; (a type of DSP that includes &lt;a href="http://www.fftw.org/links.html"&gt;FFT&lt;/a&gt;) is another.&lt;br /&gt;• Use &lt;span style="color: rgb(255, 255, 153);"&gt;Autotuners&lt;/span&gt; to select the most effective implementation of a library, of a dwarf or other pattern, at development or deploy time.&lt;br /&gt;• Programming models to be more human-centric (to help developers with concurrency issues).&lt;br /&gt;• Programming models to be independent of the number of processors where an application is deployed.&lt;br /&gt;• Systems to include performance and &lt;span style="color: rgb(153, 255, 153);"&gt;energy &lt;/span&gt;counters adapted to multicore and for use by developers.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://view.eecs.berkeley.edu/blog/"&gt;The blog&lt;/a&gt; - very useful, I recommend it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://view.eecs.berkeley.edu/wiki/Main_Page"&gt;The wiki&lt;/a&gt;. I don't know how complete this section is but it is useful start: &lt;a href="http://view.eecs.berkeley.edu/wiki/Parallel_Programming_Model_Watch"&gt;Parallel Programming Model Watch&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://view.eecs.berkeley.edu/wiki/Glossary_of_terms"&gt;glossary&lt;/a&gt; is also useful and necessary to read this wiki.&lt;br /&gt;&lt;br /&gt;A &lt;a href="http://developers.slashdot.org/comments.pl?sid=07/02/10/2014255"&gt;discussion on Slashdot&lt;/a&gt;. Entries show that many if not most developers have a weak grasp of the issues. There's a lot of work to be done for multicores to be effectively used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-5761217788205099296?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/5761217788205099296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=5761217788205099296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/5761217788205099296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/5761217788205099296'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/02/dave-patterson-et-al-uc-berkely.html' title='Dave Patterson, et al., U.C., Berkely'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-117062965579028096</id><published>2007-02-04T17:53:00.000-05:00</published><updated>2007-03-04T17:53:09.378-05:00</updated><title type='text'>More contenders for the solution</title><content type='html'>&lt;a href="http://radar.oreilly.com/archives/2007/01/threads_conside.html"&gt;This post&lt;/a&gt; mentions &lt;a href="http://labs.google.com/papers/mapreduce.html"&gt;MapReduce&lt;/a&gt;, used by Google. The post also mentions &lt;span style="color: rgb(255, 255, 153);"&gt;E&lt;/span&gt;, &lt;a href="http://www.erlang.org/"&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;Erlang&lt;/span&gt;&lt;/a&gt;, &lt;span style="color: rgb(255, 255, 153);"&gt;Haskell&lt;/span&gt;, &lt;span style="color: rgb(255, 255, 153);"&gt;Hadoop&lt;/span&gt;, &lt;span style="color: rgb(255, 255, 153);"&gt;OCaml&lt;/span&gt;, &lt;span style="color: rgb(255, 255, 153);"&gt;Smalltalk &lt;/span&gt;(a precursor to Java).&lt;br /&gt;&lt;br /&gt;About &lt;span style="color: rgb(255, 255, 153);"&gt;MapReduce&lt;/span&gt;, from the link above: &lt;span style=""&gt;"Programs written in this functional style are automatically parallelized and executed on a large cluster of commodity machines. The run-time system takes care of the details of partitioning the input data, scheduling the program's execution across a set of machines, handling machine failures, and managing the required inter-machine communication. This allows programmers without any experience with parallel and distributed systems to easily utilize the resources of a large distributed system."&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;It looks to me that this is nice for Google but maybe not a generic solution to the concurrency problem. MapReduce appears to be a way to work around the concurrency problem by making each thread run on its own low cost computer (i.e., Linux on Intel) - the old grid solution - not a bad one.&lt;br /&gt;&lt;br /&gt;Here's an interesting &lt;a href="http://www.joelonsoftware.com/items/2006/08/01.html"&gt;intro to MapReduce&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;TODO evaluate.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/OCaml"&gt;OCaml&lt;/a&gt; - apparently far from the solution yet: &lt;span style="font-size:85%;"&gt;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;OCaml bytecode and native code programs can be written in a &lt;a href="http://en.wikipedia.org/wiki/Thread_%28computer_science%29" title="Thread (computer science)"&gt;multithreaded&lt;/a&gt; style. However, because the garbage collector is not designed for concurrency, multiple OCaml threads in the same process cannot run concurrently&lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Also see &lt;a href="http://en.wikipedia.org/wiki/O%27Haskell"&gt;O'Haskell&lt;/a&gt;. A very recent and still academic language. &lt;/span&gt;&lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;Don Stewart wrote:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt;"&lt;/span&gt;&lt;/span&gt;O'Haskell is an experimental object oriented extension to Haskell. It is not a concurrency extension.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;Haskell is by default concurrent and parallell&lt;/span&gt;. Normal everyday Haskell, as compiled by &lt;a rel="nofollow" target="_blank" href="http://haskell.org/ghc"&gt;GHC&lt;/a&gt; supports both multithreaded concurrency and multicore paralellism.&lt;br /&gt;&lt;br /&gt;For an overview of the playground for concurrency and parallelism that is modern Haskell, see this &lt;a rel="nofollow" target="_blank" href="http://www.haskell.org/pipermail/haskell-cafe/2007-January/021716.html"&gt;summary&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In particular, Haskell provides SMP threads (so you can use all your cores), along with &lt;a rel="nofollow" target="_blank" href="http://www2.blogger.com/software%20transactional%20memory"&gt;software transactional memory&lt;/a&gt;, for non-blocking synchronisation, which is not available in any other widely used language. "&lt;/blockquote&gt;&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt;Haskell looks like a contender, thanks to Don.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 153); font-weight: bold;"&gt;E&lt;/span&gt; is a p2p scripting language &lt;a href="http://erights.org/"&gt;http://erights.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Hadoop"&gt;Hadoop&lt;/a&gt; is a beta &lt;span style="color: rgb(255, 255, 153);"&gt;Java &lt;/span&gt;framework from Apache &lt;/span&gt;&lt;/span&gt;supporting distributed applications running on large clusters&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt;. &lt;/span&gt;&lt;/span&gt;In this &lt;a href="http://radar.oreilly.com/archives/2007/01/threads_conside.html"&gt;Jan. 23, 2007, blog "Threads considered harmful"&lt;/a&gt; Nat Torkington called Hadoop &lt;span style="font-style: italic;"&gt;"the open source &lt;span style="color: rgb(255, 255, 153);"&gt;MapReduce &lt;/span&gt;implementation"&lt;/span&gt;.&lt;br /&gt;&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;Here's &lt;a href="http://www.artima.com/forums/flat.jsp?forum=276&amp;thread=192809"&gt;a forum thread&lt;/a&gt; on the above blog post "Threads Considered Harmful" by&lt;/span&gt;&lt;/span&gt;&lt;span class="author"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;Nat Torkington on&lt;/span&gt;&lt;span style=""&gt;&lt;span style="font-size:100%;"&gt; O'Reilly's Radar blog.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-117062965579028096?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/117062965579028096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=117062965579028096' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/117062965579028096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/117062965579028096'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/02/more-contenders-for-solution.html' title='More contenders for the solution'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-117037898016184495</id><published>2007-02-01T19:58:00.000-05:00</published><updated>2007-02-01T20:19:30.836-05:00</updated><title type='text'>Ms Crawford sells IBM Roadrunner</title><content type='html'>&lt;span id="intelliTXT"&gt;&lt;p&gt; Catherine Crawford, cait@alum.mit.edu, chief architect for next-generation systems software at IBM Systems Group's Quasar Design Center, writes &lt;a href="http://www.informationweek.com/news/showArticle.jhtml?articleID=197001130"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;span id="intelliTXT"&gt;"Where's the software to take advantage of all these processors, cores and threads?"&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span id="intelliTXT"&gt;"&lt;/span&gt;&lt;span id="intelliTXT"&gt;IDC's Earl Joseph concluded in a study on technical computing software that 'many ISV codes today scale only to 32 processors, and some of the most important ones for industry don't scale beyond four processors' (www.hpcwire.com/hpc/&lt;/span&gt;&lt;span id="intelliTXT"&gt;43036§0&lt;/span&gt;&lt;span id="intelliTXT"&gt;. html).&lt;/span&gt;&lt;span id="intelliTXT"&gt;"&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;span id="intelliTXT"&gt;The &lt;span style="color: rgb(255, 255, 153);"&gt;Roadrunner &lt;/span&gt;system from IBM is alledged to enabled easier development of multithreading software but does not provide substancial information. The reader must then google Roadrunner IBM in order to get the marketing material on this new product line. Exactly what IBM wants us to do so that we may come to believe that Roadrunner is a solution, if we read enough about it.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-117037898016184495?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/117037898016184495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=117037898016184495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/117037898016184495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/117037898016184495'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/02/ms-crawford-sells-ibm-roadrunner.html' title='Ms Crawford sells IBM Roadrunner'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116939261401058840</id><published>2007-01-21T10:11:00.000-05:00</published><updated>2007-01-21T10:16:54.990-05:00</updated><title type='text'>Sun's FORTRESS is now open source</title><content type='html'>&lt;a href="http://fortress.sunsource.net/"&gt;http://fortress.sunsource.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Fortress code is concurrent by default and requires programmers to specify when a code section is not concurrent, which was my thinking also a few months ago.&lt;br /&gt;&lt;br /&gt;Summary article &lt;a href="http://news.techrepublic.com.com/clickthru.aspx?typeid=30&amp;part=rss&amp;amp;tag=rss&amp;siteid=2&amp;amp;topicid=40&amp;amp;storyid=1497433"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Sun has recently lost the continuation for a nice military contract for a new supercomputer architecture to IBM and Cray, and this open sourcing may have something to do with this loss.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116939261401058840?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116939261401058840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116939261401058840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116939261401058840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116939261401058840'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/01/suns-fortress-is-now-open-source.html' title='Sun&apos;s FORTRESS is now open source'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116819653822171515</id><published>2007-01-07T13:57:00.000-05:00</published><updated>2007-01-07T15:37:05.136-05:00</updated><title type='text'>Cringely says no apps for multicores in 2007</title><content type='html'>One of &lt;a href="http://www.pbs.org/cringely/pulpit/2007/pulpit_20070105_001440.html"&gt;Cringely's predictions for 2007&lt;/a&gt; involves multi-core chips and the difficulties of multithreading:&lt;br /&gt;&lt;blockquote&gt;"5) AMD and Intel continue to beat the crap out of each other with customers gaining but wondering why there is no software that supports those new 8-way processors, as both compilers and third-party developers fail to keep up."&lt;/blockquote&gt;Unfortunately, he doen't mention ideas for solutions. Nevertheless, realizing that we have a problem would help us towards the solution.&lt;br /&gt;&lt;br /&gt;Cringely has not predicted a wave of bugs appearing in old applications when people start using multicore chips. I wonder if he is aware of this possible future type of events.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116819653822171515?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116819653822171515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116819653822171515' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116819653822171515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116819653822171515'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2007/01/cringely-says-no-apps-for-multicores.html' title='Cringely says no apps for multicores in 2007'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116740633819016217</id><published>2006-12-29T10:27:00.000-05:00</published><updated>2007-01-21T10:21:39.336-05:00</updated><title type='text'>Transactional Memory - A Contender for The Solution</title><content type='html'>This unproven technique is apparently implemented in the announced &lt;a href="http://www.azulsystems.com/"&gt;Azul Systems&lt;/a&gt; product (supported by IBM and BAE, and sued by Sun). TM may be a valid solution for many situations for multithreaded apps. Here's a biblio:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.cs.wisc.edu/trans-memory/biblio/index.html"&gt;http://www.cs.wisc.edu/trans-memory/biblio/index.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;TODO evaluate technology - there are a few recent opinions in the java concurrent mailing list.&lt;br /&gt;&lt;br /&gt;Update 2007.01.21: &lt;a href="http://acmqueue.com/modules.php?name=Content&amp;pa=showpage&amp;amp;pid=444"&gt;ACM article&lt;/a&gt; by Intel and Stanford U. - TODO read carefully&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116740633819016217?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116740633819016217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116740633819016217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116740633819016217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116740633819016217'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/transactional-memory-contender-for.html' title='Transactional Memory - A Contender for The Solution'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116733388764190092</id><published>2006-12-28T14:06:00.000-05:00</published><updated>2007-10-13T14:24:17.861-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='multi-threading'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='java ee'/><category scheme='http://www.blogger.com/atom/ns#' term='multithreading'/><category scheme='http://www.blogger.com/atom/ns#' term='desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><title type='text'>Desktop Java EE Apps Anyone?</title><content type='html'>Here's an extract from a &lt;a href="http://forums.java.net/jive/thread.jspa?messageID=179496"&gt;post&lt;/a&gt; by Bill Shannon, Java EE Spec Lead, on &lt;span style="color: rgb(255, 255, 153);"&gt;Java EE App Clients&lt;/span&gt;. I am evaluating the use of Java EE technology on the desktop to reduce the costs of delivering defect free multithreaded apps. The idea is to try to mostly let the Java EE container manage the threads and no server would be used. It's a complete Java EE on the desktop, standalone (no server). The Java EE container(s), server-side and client-side, would be running on the desktop. In the current Java EE design, the Java EE server-side container still runs on a separate host, but not in my experimental design. One could always have the application start the Java EE server-side container if it needs to when it starts (when the app starts that is).&lt;br /&gt;&lt;br /&gt;The main difficulties may be in deployment, e.g., very large jars, the automation of the installation the Java EE container (on the desktop), etc., but these may still be simpler than producing defect free multithreaded apps without Java EE.&lt;br /&gt;&lt;br /&gt;It looks like *&lt;span style="color: rgb(255, 255, 153);"&gt;app clients&lt;/span&gt;* are applications running in a Java EE client-side container. The other alternative, of course, is to use a &lt;span style="color: rgb(255, 204, 255);"&gt;browser &lt;/span&gt;for the user interface objects via &lt;span style="color: rgb(255, 204, 255);"&gt;http &lt;/span&gt;to the Java EE code (on the desktop), instead of the Java SE GUI offered by an &lt;span style="color: rgb(255, 255, 153);"&gt;app client&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Finally, here's the post that I promised:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 255, 153); font-weight: bold; font-style: italic;"&gt;Re: Java EE appclients vs standalone clients&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 204, 204); font-style: italic;"&gt;Posted: Nov 27, 2006 1:40 PM  &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Apparently there's some confusion over application clients. To quote from the Java EE platform spec:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;....Application clients are Java programming language&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;....programs that are typically GUI programs that execute&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;....on a desktop computer. Application clients offer a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;....user experience similar to that of native applications,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;....and have access to all of the facilities of the Java EE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;....middle tier.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Application clients are not expected to execute on the server, although some people have found that useful in some situations.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Application clients are simply standalone Java applications that execute in an environment that conveniently provides access to the Java EE facilities. It's the application client container that provides Java EE support to the application client program.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Some people want to run "regular" Java SE applications, but have access to Java EE facilities without need for the application client container. Yes, you can do this. There's no magic here. But there is a lot of work. You can duplicate most or all of the work that the application client container is doing for you, and thus run your "standalone" Java EE client application without using the application client container.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;...&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;What we've done in GlassFish, and what we're considering adding to the specification, is add support for Java Web Start for deploying application clients. This allows the client desktop machine to download the application client program on demand.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Some people want to use their own deployment approaches, automated or manual, for deploying their desktop applications. What they'd like is to have a simple, small jar file or other bundle that is their application client, and run that application just like they would run any other Java SE application. This is the case that drives people to "standalone applications" instead of application clients.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;What we should do is create a simpler "application client runtime", as similar as possible to the simple "java" command, that could be used to run these applications.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The final deficiency, and one of the harder problems to solve, is that the application client container depends on the application server fairly heavily, e.g., for configuring access to resources. If the server is unavailable (due to network problems or whatever), the application client has no reasonable way to function in any sort of degraded mode until the server is available again. Improving this definitely requires work in the GlassFish implementation, and may also require changes to the Java EE specification.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Bill Shannon&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Java EE Spec Lead  &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116733388764190092?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116733388764190092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116733388764190092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116733388764190092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116733388764190092'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/java-ee-application-clients-for.html' title='Desktop Java EE Apps Anyone?'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116699269216684996</id><published>2006-12-24T15:36:00.000-05:00</published><updated>2006-12-29T10:41:56.396-05:00</updated><title type='text'>security: extended-validation certificate (EV) and alerts</title><content type='html'>&lt;a href="http://news.yahoo.com/s/ap/20061224/ap_on_hi_te/internet_padlocks"&gt;http://news.yahoo.com/s/ap/20061224/ap_on_hi_te/internet_padlocks&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;because security is another critical issue, specially for online businesses.&lt;br /&gt;&lt;br /&gt;update: &lt;a target="_blank" href="http://www.certstation.com/"&gt;www.certstation.com&lt;/a&gt; - an aggregate of 8 alert services&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116699269216684996?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116699269216684996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116699269216684996' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116699269216684996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116699269216684996'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/security-extended-validation.html' title='security: extended-validation certificate (EV) and alerts'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116679631823696762</id><published>2006-12-22T08:51:00.000-05:00</published><updated>2006-12-24T15:41:45.706-05:00</updated><title type='text'>Two big steps for a thread-safe object-based app</title><content type='html'>1) Build well-designed thread-safe objects (classes) for the app.&lt;br /&gt;&lt;br /&gt;2) Make sure that the objects interact in a thread-safe way in the application.&lt;br /&gt;&lt;br /&gt;This was re-stated by Brian Goetz at Javapolis 2006. Brian proposed that the use of an object-oriented language, good object design, and this two-step process, do help minimize the costs of developing a thread-safe application these days.&lt;br /&gt;&lt;br /&gt;It's just that both step 1 and 2 are relatively very expensive and often improperly done, which results in defects. The resulting total costs are comparable to and may surpass the costs of using Java EE correctly. It may be that in 2007 and 2008, the least expensive way to develop thread-safe applications is the use of Java EE version 5, possibly even for desktop apps.&lt;br /&gt;&lt;br /&gt;TODO look into ways to use Java EE 5 on the desktop, with and without an http-based user interface (e.g., with Swing).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116679631823696762?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116679631823696762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116679631823696762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116679631823696762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116679631823696762'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/two-big-steps-for-thread-safe-object.html' title='Two big steps for a thread-safe object-based app'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116679515280686732</id><published>2006-12-22T08:43:00.000-05:00</published><updated>2006-12-22T08:48:52.436-05:00</updated><title type='text'>New Java Tool to Test Synchronization Issues: ConTest</title><content type='html'>&lt;span style="font-weight: bold;"&gt;ConcurrentTesting - Advanced Testing for Multi-Threaded Applications&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;from IBM Alphaworks: &lt;a href="http://www.alphaworks.ibm.com/tech/contest"&gt;http://www.alphaworks.ibm.com/tech/contest&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;TODO: try and review&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116679515280686732?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116679515280686732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116679515280686732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116679515280686732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116679515280686732'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/new-java-tool-to-test-synchronization.html' title='New Java Tool to Test Synchronization Issues: ConTest'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116640832923187392</id><published>2006-12-17T21:16:00.000-05:00</published><updated>2007-01-04T19:29:36.323-05:00</updated><title type='text'>Thread-Safety According to Intel</title><content type='html'>Advanced:&lt;br /&gt;&lt;a href="http://www3.intel.com/cd/ids/developer/asmo-na/eng/327695.htm"&gt;http://www3.intel.com/cd/ids/developer/asmo-na/eng/327695.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Beginner:&lt;br /&gt;&lt;a href="http://www3.intel.com/cd/ids/developer/asmo-na/eng/327681.htm"&gt;http://www3.intel.com/cd/ids/developer/asmo-na/eng/327681.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Update 2007.01.04:&lt;br /&gt;&lt;a href="http://www3.intel.com/cd/ids/developer/asmo-na/eng/219575.htm"&gt;http://www3.intel.com/cd/ids/developer/asmo-na/eng/219575.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116640832923187392?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116640832923187392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116640832923187392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116640832923187392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116640832923187392'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/thread-safety-according-to-intel.html' title='Thread-Safety According to Intel'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116567840257018191</id><published>2006-12-09T10:27:00.000-05:00</published><updated>2006-12-09T11:43:00.550-05:00</updated><title type='text'>Is FORTRESS an Improvement over Java?</title><content type='html'>Guy Steele describes his &lt;a href="http://research.sun.com/projects/plrg/"&gt;FORTRESS programming language&lt;/a&gt; as an improvement over FORTRAN and seems to imply that is equivalent to Java, but is it?&lt;br /&gt;&lt;br /&gt;Steele has been quoted as saying &lt;span style="color: rgb(255, 255, 153);"&gt;"FORTRESS is to FORTRAN what Java is to C/C++"&lt;/span&gt;. But if FORTRESS is as generic as it also has been described and if it is as good at easing the pains of developing concurrent applications as some claim (Hal Stern and James Gosling for example), then it may be worth considering as a replacement for Java also, and not just for FORTRAN?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116567840257018191?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116567840257018191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116567840257018191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116567840257018191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116567840257018191'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/is-fortress-improvement-over-java.html' title='Is FORTRESS an Improvement over Java?'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116567806945180953</id><published>2006-12-09T10:26:00.000-05:00</published><updated>2006-12-09T10:37:56.146-05:00</updated><title type='text'>Sun's CoolThread, Niagara, and the Rock</title><content type='html'>T1, T2000, etc.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.theinquirer.net/default.aspx?article=36247"&gt;http://www.theinquirer.net/default.aspx?article=36247&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;TODO summary here&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116567806945180953?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116567806945180953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116567806945180953' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116567806945180953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116567806945180953'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/suns-coolthread-niagara-and-rock.html' title='Sun&apos;s CoolThread, Niagara, and the Rock'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116567798475374871</id><published>2006-12-09T10:24:00.000-05:00</published><updated>2006-12-09T11:40:33.893-05:00</updated><title type='text'>New Azul Multicore Systems for Java</title><content type='html'>Note that Sun is suing Azul for patent infrigments.&lt;br /&gt;&lt;a href="http://www.theinquirer.net/default.aspx?article=31461"&gt;http://www.theinquirer.net/default.aspx?article=31461&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;TODO more here on the new Azul systems&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116567798475374871?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116567798475374871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116567798475374871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116567798475374871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116567798475374871'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/12/new-azul-multicore-systems-for-java.html' title='New Azul Multicore Systems for Java'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116484730132916816</id><published>2006-11-29T19:38:00.000-05:00</published><updated>2006-11-29T19:41:41.550-05:00</updated><title type='text'>JSR 121 App Isolation API is not the solution</title><content type='html'>JSR 121 Application Isolation API may be a good solution for some problems but not for the easier concurrent programming one.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://jcp.org/en/jsr/detail?id=121"&gt;http://jcp.org/en/jsr/detail?id=121&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.java.net/blog/mlam/archive/2006/11/multitasking_th_1.html"&gt;A recent post about JSR 121&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116484730132916816?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116484730132916816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116484730132916816' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116484730132916816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116484730132916816'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/jsr-121-app-isolation-api-is-not.html' title='JSR 121 App Isolation API is not the solution'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116445893029937870</id><published>2006-11-25T07:46:00.000-05:00</published><updated>2006-12-02T18:19:15.750-05:00</updated><title type='text'>Gradual steps or paradigm shift towards easier concurrent apps?</title><content type='html'>Herb Sutter's distinguishing argument is for a &lt;span style="font-weight: bold; color: rgb(255, 255, 153);"&gt;gradual &lt;/span&gt;evolution of programming languages and techniques (IDEs, APIs) towards easier concurrent program development.&lt;br /&gt;&lt;br /&gt;My take on this is that we can only do gradual evolution right now because we don't really know how to do easy concurrent programs, i.e., we don't have an adequate programming language yet, but &lt;span style="font-style: italic;"&gt;gradual &lt;/span&gt;is not sufficient (because still too difficult) and we will need a completely different language, asap.&lt;br /&gt;&lt;br /&gt;Gradual steps may take us there eventually but what we will have once we get there will be a paradigm shift, a completely different type of programming language.&lt;br /&gt;&lt;br /&gt;I propose that the new language that we try does concurrency by default and that in general a programmer will have to write specific instructions in order to bypass the built-in concurrency features and get a non-concurrent process or structure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116445893029937870?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116445893029937870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116445893029937870' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116445893029937870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116445893029937870'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/gradual-steps-or-paradigm-shift.html' title='Gradual steps or paradigm shift towards easier concurrent apps?'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116445878076009583</id><published>2006-11-25T07:27:00.000-05:00</published><updated>2006-11-25T07:49:22.840-05:00</updated><title type='text'>Herb Sutter advocates new languages for concurrency</title><content type='html'>I agree with Herb on that one and on other issues. Here are two seminal documents from Herb.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.gotw.ca/publications/concurrency-ddj.htm"&gt;http://www.gotw.ca/publications/concurrency-ddj.htm&lt;/a&gt; - Updated version of &lt;span style="font-style: italic;"&gt;The free lunch is over&lt;/span&gt; article.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://irbseminars.intel-research.net/HerbSutter.pdf"&gt;http://irbseminars.intel-research.net/HerbSutter.pdf&lt;/a&gt; - Slides of Herb's presentation at Intel Research, Berkeley, California, September 25, 2006.&lt;br /&gt;&lt;br /&gt;TODO here summary of Herb's views.&lt;br /&gt;&lt;br /&gt;Herb is a C++ guru currently working on general concurrency issues, including a project at Microsoft. His distinguishing argument is for a &lt;span style="font-weight: bold; color: rgb(255, 255, 153);"&gt;gradual &lt;/span&gt;evolution of programming languages and techniques (IDEs, APIs) towards easier concurrent program development.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116445878076009583?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116445878076009583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116445878076009583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116445878076009583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116445878076009583'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/herb-sutter-advocates-new-languages.html' title='Herb Sutter advocates new languages for concurrency'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116372152439604086</id><published>2006-11-16T18:55:00.000-05:00</published><updated>2006-11-18T12:19:26.836-05:00</updated><title type='text'>CSP for Java On IBM Developerworks</title><content type='html'>&lt;a href="http://www-128.ibm.com/developerworks/java/library/j-csp1.html"&gt;This is a 3 part series&lt;/a&gt;. Very important.&lt;br /&gt;&lt;br /&gt;CSP = Communicating Sequential Processes&lt;br /&gt;&lt;br /&gt;The main questions for us about CSP are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;What are the situations where CSP may be advantageous?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If any, then when do we use it instead of using &lt;span style="color: rgb(153, 255, 255);"&gt;java.util.concurrent&lt;/span&gt; directly?&lt;/li&gt;&lt;/ol&gt;We will try to answer these questions in this blog, as well as other questions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116372152439604086?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116372152439604086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116372152439604086' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116372152439604086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116372152439604086'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/csp-for-java-on-ibm-developerworks.html' title='CSP for Java On IBM Developerworks'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116372128764962503</id><published>2006-11-16T18:52:00.000-05:00</published><updated>2006-11-16T18:54:47.760-05:00</updated><title type='text'>IBM Thread and Monitor Dump Analyzer for Java</title><content type='html'>&lt;a href="http://www.alphaworks.ibm.com/tech/jca?open&amp;S_TACT=105AGX59&amp;amp;S_CMP=GR&amp;amp;ca=dgr-jw26awjca"&gt;version 1.0.4&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116372128764962503?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116372128764962503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116372128764962503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116372128764962503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116372128764962503'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/ibm-thread-and-monitor-dump-analyzer.html' title='IBM Thread and Monitor Dump Analyzer for Java'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116372111914483890</id><published>2006-11-16T18:48:00.000-05:00</published><updated>2006-11-18T16:11:29.133-05:00</updated><title type='text'>Thread Threat - Vladimir Roubtsov, JavaWorld.com, Feb. 2003</title><content type='html'>&lt;a href="http://www.javaworld.com/javaworld/javaqa/2003-02/01-qa-0214-threadsafe.html"&gt;An introduction to concurrency&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116372111914483890?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116372111914483890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116372111914483890' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116372111914483890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116372111914483890'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/thread-threat-vladimir-roubtsov.html' title='Thread Threat - Vladimir Roubtsov, JavaWorld.com, Feb. 2003'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116337040047177717</id><published>2006-11-12T17:25:00.000-05:00</published><updated>2007-10-13T14:32:57.795-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='multi-threading'/><category scheme='http://www.blogger.com/atom/ns#' term='thread'/><category scheme='http://www.blogger.com/atom/ns#' term='threads'/><category scheme='http://www.blogger.com/atom/ns#' term='multithreading'/><category scheme='http://www.blogger.com/atom/ns#' term='jcip'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><title type='text'>Characteristics of Thread-Safe Programs</title><content type='html'>1. It is usually easier to design thread safety at an early design stage than to modify existing code.&lt;br /&gt;&lt;br /&gt;2. A program consisting of thread-safe classes may not be thread-safe and a thread-safe program may contain some classes that are not thread-safe. (jcip p.15)&lt;br /&gt;&lt;br /&gt;3. We do not yet have a formal definition of thread safety in general and we do not have formal techniques for stating a complete definition of thread safety for a given class. This poor state of affairs in the world of so-called &lt;span style="font-style: italic;"&gt;computer science&lt;/span&gt; is mainly due to the lack of a technique for formal and complete definitions of program &lt;span style="font-style: italic;"&gt;correctness&lt;/span&gt;. If any such techniques exist, they are not in common use, at least not in commercial software. Techniques that I studied for this purpose, in the 1980's for example, where often more complex than the code that they were describing.&lt;br /&gt;&lt;br /&gt;4. In theory, a &lt;span style="font-style: italic;"&gt;correct &lt;/span&gt;class means that the class conforms to its specification (what it is supposed to do). And frequently, classes specifications are vague (i.e., informal and incomplete) and single-threaded correctness is often assumed when no incorrect behavior is observed. In many cases, the source code of the class &lt;span style="font-style: italic;"&gt;is &lt;/span&gt;the specification. In the best cases, the correctness of a class is defined by associated testing classes and test cases (data sets for testing) that define the input and matching output of each of the methods of the class. The validity of correctness-by-testing is dependent on the correctness of the testing classes and data sets. This is like a house of cards.&lt;br /&gt;&lt;br /&gt;5. The definition of thread-safe class from the JCiP book: A class is thread-safe when it behaves correctly for a single thread and it continues to behave correctly when used by multiple threads, and with no additional synchronization or other coordination on the part of the calling code.&lt;br /&gt;&lt;br /&gt;6. My current definition of a thread-safe class: &lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;A class is deemed thread-safe when it complies with the &lt;a href="http://multithreading.blogspot.com/2006/11/mandatory-rules-for-safe.html"&gt;Mandatory Basic Rules&lt;/a&gt; in this blog&lt;/span&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116337040047177717?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116337040047177717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116337040047177717' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116337040047177717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116337040047177717'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/characteristics-of-thread-safe.html' title='Characteristics of Thread-Safe Programs'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116336349434797273</id><published>2006-11-12T15:09:00.000-05:00</published><updated>2007-11-21T18:47:31.052-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rules'/><category scheme='http://www.blogger.com/atom/ns#' term='multi-threading'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='multithreading'/><category scheme='http://www.blogger.com/atom/ns#' term='how-to'/><category scheme='http://www.blogger.com/atom/ns#' term='how to'/><category scheme='http://www.blogger.com/atom/ns#' term='concurrency'/><title type='text'>Mandatory Rules for Safe Multithreading in Java in 2006</title><content type='html'>Much of this post is inspired by the first few chapters of the &lt;a href="http://www.jcip.net/"&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;jcip &lt;/span&gt;&lt;/a&gt;book. It is also based on my experience.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 255, 153); font-weight: bold;"&gt;1) State Variables Must be Synchronized: &lt;/span&gt;When more than one thread access a state variable (var), and one of them might write to it, then they all must synchronize their access to it.&lt;br /&gt;&lt;br /&gt;1.1. A &lt;span style="color: rgb(255, 255, 153);"&gt;state var&lt;/span&gt; is a variable for a single instance or all instances of a class, aka. &lt;span style="font-style: italic;"&gt;instance &lt;/span&gt;var and &lt;span style="font-style: italic;"&gt;class &lt;/span&gt;var respectively. A state var is also called a &lt;span style="font-style: italic; color: rgb(255, 255, 153);"&gt;field&lt;/span&gt;. It is &lt;span style="color: rgb(255, 204, 204);"&gt;not &lt;/span&gt;a variable defined in a method; these &lt;span style="font-style: italic; color: rgb(255, 204, 204);"&gt;local &lt;/span&gt;vars defined in a method are thread-safe because they cannot be shared with other threads (unless they are copied to some other location that can be shared). In Java, an instance var is defined as non-static (the &lt;span style="color: rgb(153, 255, 255);"&gt;static &lt;/span&gt;qualifier is absent) and a class var uses the &lt;span style="color: rgb(153, 255, 255);"&gt;static&lt;/span&gt; qualifier. It is a common and critical misconception to consider that instance variables are thread-safe and that only &lt;span style="color: rgb(153, 255, 255);"&gt;static &lt;/span&gt;variables need protection (e.g., a guard or lock).&lt;br /&gt;&lt;br /&gt;1.2. A stateless class is thread-safe if it uses only thread-safe classes. A stateless class is one that has no fields and that does not reference any fields from other classes. It may have local variables, i.e., variables defined in a method.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 255, 153);"&gt;2) Missing Synchronization &lt;span style="font-style: italic; color: rgb(255, 255, 204);"&gt;Is &lt;/span&gt;a Defect:&lt;/span&gt; A program that is missing needed synchronization may appear to work well for years but may fail at any moment and must be considered defective and must be fixed urgently.&lt;br /&gt;&lt;br /&gt;2.1. The occurrences of programs with missing synchronization exhibiting erroneous behavior and producing incorrect data will be greatly increased with the advent of multicore chips in desktop computers and in servers replacing single-chip machines.&lt;br /&gt;&lt;br /&gt;2.2. Applications that have been exhibiting correct behavior on &lt;a href="http://en.wikipedia.org/wiki/Symmetric_multiprocessing"&gt;SMP&lt;/a&gt; machines should show less of an increase in the frequency of multithreaded defects than applications running on single chip machines. This is only about the predicted increase in frequency of multithreading defects and rule #2 still applies to applications that have been running on SMP servers, i.e., if they are missing synchronization then they are defective.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 255, 153);"&gt;3) How to Synchronize: &lt;/span&gt;There are 4 basic ways to fix synchronization defects for a given state var:&lt;br /&gt;&lt;br /&gt;3.1. Don't share the state var across threads, if possible,&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;3.2. Make the state var &lt;span style="color: rgb(153, 255, 255);"&gt;final&lt;/span&gt;, if possible,&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;3.3. &lt;span style="color: rgb(255, 255, 153);"&gt;Synchronize &lt;/span&gt;accesses to the state var; if the previous two options are not possible then this one is mandatory. The ways to synchronize access to a state var:&lt;br /&gt;&lt;br /&gt;3.3.1. In some cases you may use a &lt;span style="color: rgb(153, 255, 255);"&gt;java.util.concurrent.atomic&lt;/span&gt; (j.u.c.a.) class instead of a regular (non atomic) primitive; this is sufficient when the class has only one state var, or the state vars are not interdependent, but is &lt;span style="font-weight: bold;"&gt;not &lt;/span&gt;sufficient when it has more than one state vars that need to coordinate/synchronize their updates; the atomic classes cannot be used for this coordination, therefore, in such cases, instead of atomic vars, you must use an atomic set of operations, e.g., a set of operations bounded by a lock (rule 3.3.2). In some cases, an atomic class from j.u.c.a cannot appropriately replace its corresponding primitive. The j.u.c.a. classes are primarily designed for developing non-blocking algorithms, a particular type of concurrent logic.&lt;br /&gt;&lt;br /&gt;3.3.2. Use an atomic set of operations (e.g., a set of operations bounded by a lock) to update interdependent state variables.&lt;br /&gt;&lt;br /&gt;3.3.3. If coordinated access is being done on a var, then synchronize &lt;span style="color: rgb(255, 255, 102);"&gt;with the same lock&lt;/span&gt; for all uses of that var and all the &lt;span style="font-style: italic;"&gt;invariants &lt;/span&gt;in which it and its related vars may participate, including reading the var(s). This situation is called *guarded by a lock* and the &lt;span style="color: rgb(153, 255, 255);"&gt;@GuardedBy("aLock")&lt;/span&gt; annotation is to be used for each state var that need to be coordinated.&lt;br /&gt;&lt;br /&gt;3.3.3.1. Use block synchronization of minimal sizes while minimizing the number of such blocks in each method. Possible strategy: use method synchronization (sync) when this does not affect performance significantly; otherwise use block synchronization within the method. In determining the minimal block size, try to not include local vars in block, because local vars (stack-based) are not shared across threads and do not require synchronization. Favor sync blocks that do not include calls to methods of other objects, particularly those that are lengthy or that involve operations that may block (e.g., I/O, network). Favor a small number of sync blocks per methods because each sync block has a cpu overhead cost. Nevertheless, thread safety must never be compromised and cpu cycles must be spent.&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 255, 153);"&gt;3.4. Make the Entire Class Immutable: &lt;/span&gt;this is my favorite solution when possible. An immutable class is one whose state cannot be seen to change by callers (aka. clients). This requires that:&lt;br /&gt;- all &lt;span style="color: rgb(153, 255, 255);"&gt;public &lt;/span&gt;fields are &lt;span style="color: rgb(153, 255, 255);"&gt;final&lt;/span&gt;,&lt;br /&gt;- all &lt;span style="color: rgb(153, 255, 255);"&gt;public final&lt;/span&gt; reference fields refer to other immutable objects, and&lt;br /&gt;- constructors and methods do not publish references to any hidden state which is potentially changeable (mutable); in particular, the *&lt;span style="color: rgb(153, 255, 255);"&gt;this&lt;/span&gt;* reference must not &lt;span style="color: rgb(255, 255, 102);"&gt;escape &lt;/span&gt;from any of the constructors of the class.&lt;br /&gt;&lt;br /&gt;3.4.1. Immutable objects may still have hidden mutable state for purposes of performance optimization; some state vars may be lazily computed, as long as they are computed from immutable state and that clients cannot tell the difference (they are hidden from the clients).&lt;br /&gt;&lt;br /&gt;3.4.2. Immutable objects are thread-safe; they may be passed between threads or published without synchronization.&lt;br /&gt;&lt;br /&gt;3.4.3. Making a &lt;span style="color: rgb(153, 255, 255);"&gt;static &lt;/span&gt;field immutable: use *&lt;span style="color: rgb(153, 255, 255);"&gt;final&lt;/span&gt;*, do not deserialize the class, and the field must contain a primitive or an instance of a class which is itself thread-safe. This will ensure atomicity and visibility for a &lt;span style="color: rgb(153, 255, 255);"&gt;static &lt;/span&gt;field.&lt;br /&gt;&lt;br /&gt;3.4.4. Making a NON-STATIC field immutable (an instance field): use *&lt;span style="color: rgb(153, 255, 255);"&gt;final&lt;/span&gt;* and make sure that all constructors cannot let *&lt;span style="color: rgb(153, 255, 255);"&gt;this&lt;/span&gt;* escape. Immutable classes must have thread-safe &lt;span style="color: rgb(255, 255, 153);"&gt;constructors&lt;/span&gt;. The &lt;span style="color: rgb(153, 255, 255);"&gt;final &lt;/span&gt;fields may be made &lt;span style="color: rgb(153, 255, 255);"&gt;public&lt;/span&gt;, and accessor methods are not needed, which also improves performance.&lt;br /&gt;&lt;br /&gt;3.4.5. Serialization: It may be possible to create an immutable class that can be serialized and deserialized, but it may be so complex that it may not be worth the development costs, and in general, if a class needs to be serialized and deserialized, it may be less expensive to not try to make it immutable and to make it a plain thread-safe class.&lt;br /&gt;&lt;br /&gt;3.4.6. For similar reasons than for 3.4.5. Serialization, in general, it is usually expedient to &lt;span style="color: rgb(255, 255, 153);"&gt;not &lt;/span&gt;make immutable  &lt;span style="color: rgb(255, 255, 153);"&gt;beans &lt;/span&gt;or classes that are loaded &lt;span style="color: rgb(255, 255, 153);"&gt;programmatically&lt;/span&gt;, if that bean or programmatic class has fields that require values set by the constructor(s) parameters, which is often the case.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 255, 153);"&gt;4) How to use &lt;/span&gt;&lt;span style="color: rgb(153, 255, 255);"&gt;VOLATILE&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(153, 255, 153);"&gt;:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4.1. &lt;span style="color: rgb(255, 204, 153);"&gt;Try not to use &lt;span style="color: rgb(153, 255, 255);"&gt;volatile&lt;/span&gt; - use &lt;span style="color: rgb(153, 255, 255);"&gt;volatile &lt;/span&gt;only when all these conditions are met:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;-&lt;/span&gt; writing to the shared var without using its current value or when only a single thread updates the var;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;- &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;and&lt;/span&gt; &lt;/span&gt;the var is not involved in an invariant relation;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;- &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;and&lt;/span&gt; &lt;/span&gt;the var is not of type &lt;span style="color: rgb(153, 255, 255);"&gt;long &lt;/span&gt;or &lt;span style="color: rgb(153, 255, 255);"&gt;double&lt;/span&gt;: these primitives are not atomic and such shared vars must be guarded by a lock or, for a &lt;span style="color: rgb(153, 255, 255);"&gt;long &lt;/span&gt;not involved in an invariant, an &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicLong&lt;/span&gt;, instead of a &lt;span style="color: rgb(153, 255, 255);"&gt;volatile &lt;/span&gt;qualifier, and for a &lt;span style="color: rgb(153, 255, 255);"&gt;double &lt;/span&gt;not involved in an invariant, a &lt;span style="color: rgb(153, 255, 255);"&gt;BigDecimal &lt;/span&gt;may be considered (because it is immutable thus thread-safe, although a &lt;span style="color: rgb(153, 255, 255);"&gt;BigDecimal &lt;/span&gt;may be slower than using a lock); &lt;span style="color: rgb(153, 255, 255);"&gt;volatile &lt;/span&gt;cannot guarantee atomicity and also do not protect invariants;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;- &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 255, 153);"&gt;and&lt;/span&gt; &lt;/span&gt;you are absolutely certain that locking is not required while the var is being accessed.&lt;br /&gt;&lt;br /&gt;4.2. Examples of typical use of &lt;span style="color: rgb(153, 255, 255);"&gt;volatile&lt;/span&gt;: Ensuring visibility (without the need for atomicity), e.g., boolean event notification, such as single change boolean (initialization or shutdown state indicator), or a status flag used to exit a loop. The above conditions in 4.1 must always be met.&lt;br /&gt;&lt;br /&gt;4.3. &lt;span style="color: rgb(255, 204, 204); font-weight: bold;"&gt;When in doubt, use &lt;span style="color: rgb(255, 255, 153);"&gt;locking &lt;/span&gt;instead of &lt;/span&gt;&lt;span style="color: rgb(153, 255, 255); font-weight: bold;"&gt;volatile&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(153, 255, 153);"&gt;5) Java 5 or Above: &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Do not use pre-Java 5 versions. The above rules only apply to &lt;span style="color: rgb(255, 255, 153);"&gt;Java 5 or later&lt;/span&gt;, and earlier versions of Java must &lt;span style="color: rgb(255, 255, 153);"&gt;not &lt;/span&gt;be used for mutithreaded apps. &lt;/span&gt;&lt;span&gt;This is because the memory model was fixed in Java 5 to ensure thread-safety and the earlier versions of Java are inherently not thread-safe (unless a vendor has rendered it's implementation of Java thread-safe before Java 5), and when using earlier versions of Java, developers cannot be guaranteed that using the above mandatory rules will ensure thread-safety. &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 255, 153);font-size:130%;" &gt;Non-Mandatory Rules:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;a) When a state var is protected by synchronization (i.e., a lock), do not use an atomic type from &lt;span style="color: rgb(153, 255, 255);"&gt;java.util.concurrent.atomic&lt;/span&gt; to store the value; use a regular type because this helps performance and code simplicity (better speed and lower maintenance costs).&lt;br /&gt;&lt;br /&gt;b) In your code, use the annotations defined by Brian Goetz and Tim Peierls (used in the JCiP book): &lt;span style="color: rgb(153, 255, 255);"&gt;ThreadSafe&lt;/span&gt;, &lt;span style="color: rgb(153, 255, 255);"&gt;Immutable&lt;/span&gt;, &lt;span style="color: rgb(153, 255, 255);"&gt;GuardedBy&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;c) Always use the &lt;span style="color: rgb(153, 255, 255);"&gt;-server&lt;/span&gt; option for the &lt;span style="color: rgb(153, 255, 255);"&gt;java &lt;/span&gt;command, even in development (of concurrent applications), when this option is available.&lt;br /&gt;&lt;br /&gt;d) Do not assume that any class is thread-safe, including classes from the Java SE API, unless you analyze the source code, or the class is documented to be thread-safe and you trust the developer(s). I trust the Java SE developers but unfortunately the documentation of many of their classes do not specify whether the class is safe or not.&lt;br /&gt;&lt;br /&gt;e) &lt;span style="color: rgb(255, 204, 255);"&gt;Question:&lt;/span&gt; what's the difference between &lt;span style="color: rgb(153, 255, 255);"&gt;int &lt;/span&gt;and &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicInteger&lt;/span&gt;? Is &lt;span style="color: rgb(153, 255, 255);"&gt;int &lt;/span&gt;atomic? jcip p. 36 states that lower than 64-bit vars are atomic. If &lt;span style="color: rgb(153, 255, 255);"&gt;int &lt;/span&gt;is atomic, then why use &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicInteger&lt;/span&gt;?&lt;br /&gt;&lt;span style="color: rgb(255, 204, 255);"&gt;Answer:&lt;/span&gt; Assigning an &lt;span style="color: rgb(153, 255, 255);"&gt;int &lt;/span&gt;is atomic but operations on an &lt;span style="color: rgb(153, 255, 255);"&gt;int &lt;/span&gt;that depend on its previous value are &lt;span style="color: rgb(255, 255, 102);"&gt;not &lt;/span&gt;atomic, so &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicInteger &lt;/span&gt;is designed for atomic operations with the previous value of the field. Also, an &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicInteger &lt;/span&gt;is used in applications such as atomically incremented counters, and usually cannot be used as a replacement for an &lt;span style="color: rgb(153, 255, 255);"&gt;Integer&lt;/span&gt;. Atomic classes in &lt;span style="color: rgb(153, 255, 255);"&gt;java.util.concurrent.atomic&lt;/span&gt; are designed primarily for implementing non-blocking data structures and related infrastructure classes. The &lt;span style="color: rgb(153, 255, 255);"&gt;compareAndSet &lt;/span&gt;method that they use is not a general replacement for locking because it applies only when critical updates for an object are confined to a single variable and therefore it is not applicable to invariants.&lt;br /&gt;&lt;br /&gt;f) &lt;span style="color: rgb(255, 204, 255);"&gt;Q:&lt;/span&gt; How come no &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicDouble&lt;/span&gt; in JSR 166?&lt;br /&gt;&lt;span style="color: rgb(255, 204, 255);"&gt;A:&lt;/span&gt; Because their use is very uncommon. Generally, a &lt;span style="color: rgb(153, 255, 255);"&gt;double &lt;/span&gt;field is guarded by a lock and not by an atomic class. You can easily convert an &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicInteger &lt;/span&gt;and an &lt;span style="color: rgb(153, 255, 255);"&gt;AtomicLong &lt;/span&gt;into either a &lt;span style="color: rgb(153, 255, 255);"&gt;float &lt;/span&gt;or &lt;span style="color: rgb(153, 255, 255);"&gt;double &lt;/span&gt;by using their &lt;span style="color: rgb(153, 255, 255);"&gt;floatValue()&lt;/span&gt; and &lt;span style="color: rgb(153, 255, 255);"&gt;doubleValue()&lt;/span&gt; methods.&lt;br /&gt;&lt;br /&gt;g) Values representing amounts of &lt;span style="color: rgb(255, 255, 153);"&gt;currency &lt;/span&gt;should always use &lt;span style="color: rgb(153, 255, 255);"&gt;BigDecimal&lt;/span&gt; (for precision reasons, not for &lt;span style="font-style: italic; color: rgb(255, 255, 153);"&gt;con&lt;/span&gt;currency) and a &lt;span style="color: rgb(153, 255, 255);"&gt;BigDecimal &lt;/span&gt;is immutable thus thread-safe.&lt;br /&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;TODO rendering thread-safe applications composed of thread-safe classes (in other posts).&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;TODO locking protocols, sync. policies (in other posts).&lt;br /&gt;&lt;br /&gt;TODO safety of classes generated by &lt;span style="color: rgb(153, 255, 255);"&gt;xjc &lt;/span&gt;tool in JAXB (in other posts).&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Copyright (c) 2006 Serge Masse.&lt;br /&gt;Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.  A copy of the license is in &lt;a href="http://www.gnu.org/licenses/fdl.txt"&gt;http://www.gnu.org/licenses/fdl.txt&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Java annotations (e.g., @GuardedBy, @Immutable, @ThreadSafe) in this post are copyrighted by Brian Goetz and Tim Peierls under these terms:&lt;br /&gt;Copyright (c) 2005 Brian Goetz and Tim Peierls&lt;br /&gt;Released under the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.5)&lt;br /&gt;Official home: http://www.jcip.net&lt;br /&gt;Any republication or derived work distributed in source code form must include this copyright and license notice.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116336349434797273?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116336349434797273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116336349434797273' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116336349434797273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116336349434797273'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/mandatory-rules-for-safe.html' title='Mandatory Rules for Safe Multithreading in Java in 2006'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116335476239928824</id><published>2006-11-12T12:55:00.000-05:00</published><updated>2006-11-12T13:06:02.406-05:00</updated><title type='text'>JSR-166 and the JCIP book</title><content type='html'>One of the best toolkit today for concurrent programming is the JSR-166 API in Java SE 5 and the related mailing list, &lt;a href="http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest"&gt;concurrency-interest&lt;/a&gt;, and book, &lt;a href="http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601"&gt;Java Concurrency In Practice&lt;/a&gt; (JCIP).&lt;br /&gt;&lt;br /&gt;Nevertheless, the use of these tools show that it is still very difficult to build concurrent applications and that we need even better tools, such as a new programming language and/or development tools.&lt;br /&gt;&lt;br /&gt;And until then, JSR-166, with the great support from Doug Lea and his team, are the best that we have.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116335476239928824?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116335476239928824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116335476239928824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116335476239928824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116335476239928824'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/jsr-166-and-jcip-book.html' title='JSR-166 and the JCIP book'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-37533472.post-116335121908653759</id><published>2006-11-12T12:04:00.000-05:00</published><updated>2006-11-12T12:06:59.093-05:00</updated><title type='text'>first post on multithreading</title><content type='html'>only the critical programming issues, with an emphasis on Java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/37533472-116335121908653759?l=multithreading.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://multithreading.blogspot.com/feeds/116335121908653759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=37533472&amp;postID=116335121908653759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116335121908653759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/37533472/posts/default/116335121908653759'/><link rel='alternate' type='text/html' href='http://multithreading.blogspot.com/2006/11/first-post-on-multithreading.html' title='first post on multithreading'/><author><name>serge</name><uri>http://www.blogger.com/profile/13136342734076017866</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
