You are here: Home > Programming > Java Concurrency, A Brief Introduction

Java Concurrency, A Brief Introduction

The programming language Java supports concurrent programming and all processing done in thread. In (Java Virtual Machine) JVM resource can be accessed from any of these discussions. Each thread can access an object or source in the program. Ensure that in this case, the programmer, that access to these funds are managed properly. In other words, only one thread to access resources on this point, so that all other threads are prevented from access to (partially) the updated source. Java as a programming language has a built-in support for controlling access to resources, this contest is called Java.

Competition is good for several reasons. You can minimize the delay, in order to maximize throughput, to simulate autonomous object modeling with the operation of multiprocessors and overlap I / O parallelism. Competition with Java threads must be protected by locks and so on. The implementation of the competition will, however, lead to an increase in complexity and an increased use of resources.

If multiple threads are a common resource, on either a core or multicore with you, a library competition is required. The Java library provides shared-memory competition of the competition. Competition and the exchange of messages distributed more photos. Since the calculations interact in a simultaneous system with each other while they are active, the number of possible execution paths in the system are very large, and the resulting uncertainty at the same time result in the calculation. Concomitant use of shared resources can be a source of uncertainty leads to problems such as stagnation, and the hunger for resources

Deadlock can arise when concurrent threads through locks to protect access.This is due to the fact that (or modify) multiple threads access the same memory area to try. These threads can work in parallel programming at the same time, but the competition is possible that a thread is suspended and another thread tries to access the same memory. The Java library provides competitive crashes, but can not guarantee that no deadlock. An alternative to using blocks of code in a style of writing messaging.

Message passing communication between the components through the exchange of competitors (and distance) to communicate messages. This exchange of messages can be by blocking the sender, the message is received by or asynchronously. Asynchronous message passing is reliable or unreliable.

The message-passing competition tends to be easier to understand than the competition, because it seems logical shared memory at first glance. And “as a form of robust concurrent programming. There are various mathematical theories to help the environment for the exchange of messages. Some examples are the actor-model computing environment and pi-calculus.

No related posts.

Tags: , , , , ,

Leave a Reply