Core Java Interviewfragen und Antworten
Question: What is concurrency in java?Answer:Concurrency is the ability to run several programs or several parts of a program in parallel. If a time consuming task can be performed asynchronously or in parallel, this improve the throughput and the interactivity of the program. A modern computer has several CPU's or several cores within one CPU. The ability to leverage these multi-cores can be the key for a successful high-volume application. Concurrency Issues: Threads have their own call stack, but can also access shared data. Therefore you have two basic problems, visibility and access problems. A visibility problem occurs if thread A reads shared data which is later changed by thread B and thread A is unaware of this change. An access problem can occur if several thread access and change the same shared data at the same time. Visibility and access problem can lead to
|
Zum Wiederholen speichern
Speichere diesen Eintrag als Lesezeichen, markiere ihn als schwierig oder lege ihn in einem Wiederholungsset ab.
Melde dich an, um Lesezeichen, schwierige Fragen und Wiederholungssets zu speichern.
Am hilfreichsten laut Nutzern:
- How could Java classes direct program messages to the system console, but error messages, say to a file?
- What are the differences between an interface and an abstract class?
- Why would you use a synchronized block vs. synchronized method?
- How can you force garbage collection?
- What are the differences between the methods sleep() and wait()?