1 / 12

THREADS

THREADS. Read from SCJP Book Chapter on Threads Uploaded on Wikispaces. Typical Scenario.

Download Presentation

THREADS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. THREADS Read from SCJP Book Chapter on Threads Uploaded on Wikispaces

  2. Typical Scenario • Imagine a stockbroker application with a lot of complex capabilities. One of its functions is "download last stock option prices," another is "check prices for warnings," and a third time-consuming operation is "analyze historical data for company XYZ.“ • In a single-threaded runtime environment, these actions execute one after another. The next action can happen only when the previous one is finished. If a historical analysis takes half an hour, and the user selects to perform a download and check afterward, the warning may come too late to, say, buy or sell stock as a result. • We just imagined the sort of application that cries out for multithreading.

  3. What are Threads ?

  4. What are Threads?

  5. Thread Operations

  6. Thread Life cycle

  7. Thread Class

  8. Using the Runnable Interface

  9. Creating a Thread

  10. Example

  11. Subclassing Thread

  12. Java.lang.Thread

More Related