Archive for the 'Programming' category

UDP Programming with Java

02 Mar 2011 by

Resource on UDP Programming is limited and even rare for some programming languages. For TCP Programming, I guess, there is a lot and many languages support it. For example, Java, C, C++, C#, WinSock, etc. So this article is to contribute to those limitation by taking an advantage of package that supports UDP programming interface. The understanding of UDP and TCP is required.

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

How to Return a Value from Thread

26 Feb 2011 by

Thread implementation in Java is never easier if you do following my 3 steps strictly. However, there might be a lot of question regarding return value from a thread since run() method returns void. So I will show you how to get return value from a thread.
Just to review how to implement java thread, the 3 steps are:

  1. Extends Thread class or Implements Runnable interface
  2. Override run() method
  3. In main thread, initialize thread class and then call start() method

Continue Reading »

5 responses so far

Implement Thread in Java

25 Feb 2011 by

Assume that you understand the differences between Process and Thread. If not please refer to this article (Process vs. Thread). Concurrency can be achieved both in Process and Thread. Developing concurrency process is costly and hard to manage the process behavior since all processes have their own address space. Thread has been motivated in this sense. Thread can take a lot of advantages by supporting parallelism, low cost in creating and destroying, and easy to manage. Be remember that main thread in a process can create several child threads.

Continue Reading »

One response so far