Friday, April 22, 2011

Synchronizing Java program for performance

I. Introduction :
Timing is essential in java programming, therefore java uses multiple threads (that is to say in virtually all applications). Indeed, without synchronization, it is impossible to develop a robust application that works regardless of the interleaving of execution threads.

It is considered that: you know the java syntax, object-oriented programming and general operation threads and the scheduler etc.

I.A - General Problems:
Many synchronization problems arise, these are few of them
1. Several receivers can not simultaneously make work in the line of work, otherwise the work would be on the same box.
2. If the work queue is full, the receiver must wait for a box becomes available for filing a new job.
3. Many workers can not take everyone working together, otherwise they would have the same work process.
4. If the work queue is empty, workers must wait until a job is submitted in order to treat.
5. Many workers can not simultaneously make the results of an in-line results, otherwise the results would be on the same box.
6. If the results file is full, the workers must wait for a box becomes available for filing a new result.
7. If the results file is empty, the sender must wait until a result is available.

I.B - Objectives
The goal is to solve these general problems, which can be in most cases be reduced.
To solve them properly, we must ensure:
The Safety : Nothing bad happens, whatever the interlacing of threads (two workers can never take the same job)
The vivacity : Something good finally happen (if the work queue is not empty, a worker would eventually work).

We must also take into account if possible, for example, two works may be filed consecutively executed sequentially by the same worker.

No comments:

Post a Comment