Java Concurrency – Basic Concepts

Defining and Starting a Thread There are two ways to define a thread: Provide a Runnable object or Subclass Thread. The first approach is more flexible and applicable to high-level thread concurrency APIs. It is also more general because the Runnable object can subclass a class other than Thread. Synchronization Synchronization can introduce thread contention, which occurs when two or more threads try […]