Chapter 12

Concurrency Using Threads

OBJECTIVES
  • To explain process, multitasking, thread and multithreading
  • To differentiate sequential execution and threaded execution
  • To introduce thread creation ways: Thread and Runnable
  • To explain variables inside local cache and master copy at main memory for threads
  • To instantiate thread and start a thread
  • To make thread to sleep
  • To make thread to yield control to another threads
  • To find the sum of an array using two threads
  • To suspend calling thread using join
  • To create daemon threads and explain its life
  • To introduce thread priority and also its three constants
  • To explain the importance of Runnable interface
  • To synchronize threads for resource sharing using synchronized methods
  • To introduce synchronized ...

Get JAVA Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.