It depends on what you are trying to do. Are you looking out of curiosity or is there a specific reason?
If you are trying to speed up multi-threaded methods, try synchronizing or blocking certain sections or avoiding threading problems at all; create general final data, create static (not general) ThreadLocal data, use atomic types from java.util.concurrent.atomic , use parallel collections (from java.util.concurrent packages), etc.
BTW, the material java.util.concurrent is available only in Java5, but there as a project for back-port packages for Java 1.4 at http://backport-jsr166.sourceforge.net/
I would recommend Brian Goetz's book Java Concurrency in Practice.
Gkelly
source share