1. Using threads on your application:
Users expect programs to achieve strong performance. One way to accomplish that task is to use threads.
A thread is an independent path of execution through program code. Threads benefit GUI-based programs because they allow those programs to remain responsive to users while performing other tasks.
In addition, threaded programs typically finish faster than their non-threaded counterparts. This is especially true of threads running on a multiprocessor machine, where each thread has its own processor.
2. Avoid multithreaded problems:
- lock
- race condition
- semaphores
- deadlock
- inaccessible threads
- blocking I/O
3. Utilize threads:
- synchronized
- the wait/notify mechanism
- size thread pool
- use JDK 5 java.util.concurrent
- exploring thread groups, volatility, thread-local variables, timers
- use JDK 5 java.nio for non-blocking I/O
4. Offline Concurrency Patterns: Optimistic Offline Lock, Pessimistic Offline Lock
Ref:
Java Performance Tuning
Solving common Java EE performance problems
Achieve Strong Performance with Threads






No comments yet
Comments feed for this article