Concurrency utilities with Java Tiger (J2SE 5.0)

Java 1.5 now supports thread safe queues, Timers, locks, and many other enhancements to the threading model.

To give an example of controling a critical code section with a semaphore:

 final  private Semaphore s= new Semaphore(1, true);    s.acquireUninterruptibly(); 
 try 
 {
   System.out.println("This code can only be executed by one thread at a time");
 } finally 
 {  
  s.release(); 
 }
 

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest. Other websites on Java Tiger can be found at Links-for-Java.

Home


Copyright 2006-2011 Open Merchant Account Ltd..
Free SMS UK Free SMS Ireland SMS Gratis Norway SMS Gratis Sverige Ilmainen SMS Suomi SMS Gratis Danmark SMS Tasuta Eestisse SMS Nemokamai Lietuva SMS Bezmaksas Latviju Darmowe smsy Polska SMS Zdarma Ceské SMS Zdarma Slovensko SMS Gratis Deutschland SMS Gratis Schweiz SMS Gratis Österreich SMS Gratuit Belgique SMS Gratis Nederland SMS Gratuit France SMS Gratis Espańa SMS Gratis Portugal Free SMS South Africa Free SMS USA SMS Percuma Malaysia SMS Free Hong Kong