View RSS Feed

Recent Blogs Posts

  1. Multithreading (basics)

    by , 11-13-2011 at 11:59 AM (My Java Tips)
    Multithreading is a concept where a program is broken into two or more parts called threads and all these threads run in parallel. Multithreading can make programs more responsive and effective and it increases its performance too. For example, today web pages need to display animations with sound effects and text at the same time. If this is done by using the traditional single-threaded event loop, the application will take a lot of time to get loaded, and time is a very crucial factor for web ...
    Categories
    Java SE
  2. Why use multithreading?

    by , 11-13-2011 at 11:55 AM (My Java Tips)
    In this post, I will talk about the importance of multithreading and would like to answer the question: Why use multithreading ??


    Multithreading exploits the fact that most of the time the tasks (parts) of the same program are either waiting for the other resources to become free, or waiting for some timeout to occur. In the above example (spreadsheet), scroll operation is waiting for the calculation to be completed. If these parts or tasks can be described as independent threads, ...
    Categories
    Java SE
  3. Java Threads

    by , 11-13-2011 at 11:51 AM (My Java Tips)
    A thread is a thread of execution in a program. Java environment has been built around the multithreading model. In fact all Java class libraries have been designed keeping multithreading in mind. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently. If a thread goes off to sleep for some time, the rest of the program does not get affected by this. Similarly, an animation loop can be fired that will not stop the working of rest of the system. ...
  4. Thread priorities, synchronization and messaging

    by , 11-13-2011 at 11:47 AM (My Java Tips)
    I assume that you have the basic knowledge of threads. In this post, I will write about thread priorities, synchronization and messaging.


    In multithreading environment, one thread might require the attention of the CPU more quickly than other. In such a case that thread is said to be of high priority. Priority of a thread determines the switching from one thread to another. In other words, priority determines how a thread should behave with respect to the other threads.
    ...