Performance of ReentrantLock and Synchronized

19 Apr 2011 by

ReentrantLock and Synchronized

ReentrantLock and Synchronized

Synchronized keyword is famous in locking shared variables to be modified by only one thread at the specific time. However, it has performance issue while multiple threads are trying to contend for accessing shared variables. JDK 5.0 is redesigned memory model that makes it truly cross platform for multithread environment. JDK 5.0 adds java.util.concurrent package that supports various optimized concurrency tools.

In this article, I present the performance of ReentrantLock and Synchronized. Actually, the performance has been reveal inĀ Java theory and practice: More flexible, scalable locking in JDK 5.0. However, that article did not show the source code of how to do it.

Prerequisite

Continue Reading »

5 responses so far

TCP UDP and RMI Performance Evaluation

22 Mar 2011 by

TCP UDP and RMI Throughput

TCP UDP and RMI Throughput

It is interesting to see the performance evaluation of TCP, UDP and RMI. This article shows the simple scenario to test their performance by looking at latency and throughput. The test result shows that RMI has poor performance compares to TCP and UDP. TCP and UDP has comparable result though UDP gains slightly higher than TCP.

From this work, I can draw conclusion that RMI is easy to implement the function based program but it is not good for intensive exchange packets. UDP and TCP are good for packet transmissions but they are hard to implement protocol. Though UDP has less overhead, it is not guarantee the packet delivery. At last, TCP is good for almost scenario with good administration.

Continue Reading »

6 responses so far

Performance Evaluation on Java Thread and .NET Thread

01 Mar 2011 by

Performance evaluation on Java single thread and multi-thread has already been discussed in the previous post. So I will show you all the performance of .NET thread comparable to Java thread. We did the same scenario and experimental environment as my last post. The overall Java performs much better than .NET both single thread and multi-thread.

Continue Reading »

No responses yet

Performance Evaluation on Single Thread and Multi-Thread

27 Feb 2011 by

Threading could eventually improve system capacity as multi-core and multi-processor are more common in commodity computer. We can spend less than USD 1000 to get Core-i3, Core-i5 or even Core-i7. So threading technique for enabling-threading tasks could maximize the overall system performance. Be remember that not all tasks could take advantage of multi-threading. And multi-thread is not always good since its overhead and cost in coordinating data. I will discuss this scenario in the later post.

Continue Reading »

One response so far