Java Concurrency

From Suhrid.net Wiki
Revision as of 17:23, 23 December 2011 by Suhridk (talk | contribs) (Created page with "= Concurrent Programming = * The name given to programming notations and techniques to express potential parallelism and solve the resulting communication and synchronization pr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Concurrent Programming

  • The name given to programming notations and techniques to express potential parallelism and solve the resulting communication and synchronization problems.
  • Why do we need it ? To allow the expression of potential parallelism so that more than CPU can solve the problem.
  • To model the parallelism in the real world.
  • Alternative is difficult: programmer must construct sequential program as a cyclic execution of task to handle various concurrent activities.
  • This make programming difficult and introduction of structures which are irrelevant to the problem at hand.
  • Parallel execution on multiple CPU's is difficult.
  • A concurrent program is a collection of autonomous sequential processes executing logically in parallel.
  • Each process has a single thread of control.
  • The actual implementation of these collection of processes can be via:
    • Multiprogramming: Multiple processes multiplex their executions on a single processor.
    • Multiprocessing: Multiple processes multiplex their executions on a a multiprocessor system where there is access to shared memory.
    • Distributed processing: Multiple processes multiplex their executions on several processors where they do not share memory.