838 Multithreading Chapter 15 Outline 15.1 Introduction 15.2
838 Multithreading Chapter 15 Outline 15.1 Introduction 15.2 Class Thread: An Overview of the Thread Methods 15.3 Thread States: Life Cycle of a Thread 15.4 Thread Priorities and Thread Scheduling 15.5 Thread Synchronization 15.6 Producer/Consumer Relationship without Thread Synchronization 15.7 Producer/Consumer Relationship with Thread Synchronization 15.8 Producer/Consumer Relationship: The Circular Buffer 15.9 Daemon Threads 15.10 Runnable Interface 15.11 Thread Groups 15.12 (Optional Case Study) Thinking About Objects: Multithreading 15.13 (Optional) Discovering Design Patterns: Concurrent Design Patterns Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises 15.1 Introduction It would be nice if we could do one thing at a time and do it well, but that is simply not how the world works. The human body performs a great variety of operations in parallel, or as we will say throughout this chapter, concurrently. Respiration, blood circulation and digestion, for example, can occur concurrently. All of the senses seeing, touching, smelling, tasting and hearing can all occur concurrently. An automobile can be accelerating, turning, air conditioning and playing music concurrently. Computers, too, perform operations concurrently. It is common today for desktop personal computers to be compiling a program, printing a file and receiving e-mail messages over a network concurrently. Concurrency is important in our lives. Ironically, though, most programming languages do not enable programmers to specify concurrent activities. Rather, programming languages generally provide only a simple set of control structures that enable programmers to perform one action at a time then proceed to the next action after the previous one is finished. The kind of concurrency that computers perform today normally is implemented as operating systems primitives available only to highly experienced systems programmers. The Ada programming language developed by the United States Department of Defense made concurrency primitives widely available to defense contractors building command and control systems. But Ada has not been widely used in universities and commercial industry. Java is unique among popular general-purpose programming languages in that it makes concurrency primitives available to the applications programmer. The programmer specifies that applications contain threads of execution, each thread designating a portion of a program that may execute concurrently with other threads. This capability, called multithreading, gives the Java programmer powerful capabilities not available in C and C++, the languages on which Java is based. C and C++ are called single-threaded languages.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.