Welcome to web Pages of Vicky Shiv

Resume Experience Projects Courses Thesis Download

Multi threaded Capabilities in Java

Start the Applet

Java Documentation

 

This illustrates the use of multithreading in Java. This will try to determine the speed of using threads.

Description : This is used to calculate a scalar product of two vectors, you multiple them component wise and can use up "n" threads, where n is the less than equal to number of components of the vector. Design is in form of applet. The user select the no of threads (between 1 to n ). Then clicking a start button to starts the execution with all the available threads trying to execute the calculations as fast as possible. Synchronization is done in order to maintain the integrity. As soon as thread terminates, the corresponding components of the output vector is updated. There are two version : Synchronous and Asynchronous. For the synchronous version the output vector is displayed after all the components of output vector is available. For an asynchronous mode this is done as soon as components are available. The timing fields shows the time spent on the calculation of the scalar product by the corresponding thread. Initialization of vector is done by the random number and each thread represent the unique color.

 

Implementation Details

There is only package

MyPackage

 This Package contains two classes

  • MyApplet ( this is the interface for the Assignment no 2)
  • MyThread (this is the Thread Class which is used in multiplying two vector)

 

1