Purchase Solution

concept of concurrency

Not what you're looking for?

Ask Custom Question

Describe the concept of concurrency and how threads are used to implement currency in Java.

Purchase this Solution

Solution Summary

The concept of concurrency is featured.

Solution Preview

Please find the attached document. Solution has information regarding the concurrency and how it is implememnted in JAVA.

Describe the concept of concurrency and how threads are used to implement currency in Java.

Part A)
Describe the concept of concurrency?

In computer science, concurrency is concerned with the sharing of common resources between computations which execute overlapped in time (including running in parallel). This often entails finding reliable techniques for coordinating their execution, exchanging data, allocating memory and scheduling processing time in such a way as to minimized response time and maximise throughput. Concurrent systems such as operating systems are designed to operate indefinitely and not terminate unexpectedly. However current operating systems in broad use do not fulfill this design goal in practical operation.
Because of the use of shared resources, concurrent systems in general require the use of arbiters in their implementation which gives rise to unbounded nondeterminism.
Levels of coordination can be ranked by coupling -- from tightest to loosest. Generally, the tighter the coupling between concurrent computations and the more use of a shared resource, the more contention there can be for that resource.
Concurrent programming encompasses the programming languages and algorithms used to implement such techniques. It is considered to be more general than parallel programming, because it involves shared resources that can change, whereas parallelism only entails multiple executions at the same time. Its base goals include correctness, performance and robustness.
concurrent programming with threads:
shared memory multiprocessors are cheaper and more common so each thread can be allocated a CPU;
it is less expensive and more efficient to create several threads in one process that share data than to create several processes that share data;
IO on slow devices like networks, terminals, and disks can be done in one thread while another thread does useful computation in parallel;
multiple threads can handle the events (e.g., mouse clicks) in multiple windows in the windowing system on a workstation;
in a LAN cluster of workstations or in a distributed operating system environment, a server running on one machine can spawn a thread to handle an incoming request in parallel with the main thread continuing to accept additional incoming requests.

Part B)
How threads are used to implement currency in Java?

Conceptually, the notion of a thread is not difficult to grasp: it's an independent path of execution through program code. When multiple threads execute, one thread's path through the same code usually differs from the others. For example, suppose one thread executes the byte code equivalent of an if-else statement's if part, while another thread executes the byte code equivalent of the else part. How does the JVM keep track of each thread's execution? The JVM gives each thread its ...

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C++ Operators

This quiz tests a student's knowledge about C++ operators.