What is a Thread?


Introduction

You might never need to write a program that creates threads. You might accomplish many tasks in complete ignorance of the topic and of the fact that threads have been working in the background all along, enabling your programs to run at all. On the other hand, there may come a day when you write a program that performs some time-consuming operation and after it starts, you realize that you and your program have just been taken hostage by the operation — not able to do anything else (including hit the “Cancel” button) until the operation has come to its inevitable conclusion. Hopefully, that day (if not earlier) you will remember some of what you read in this chapter, and cast off those shackles of ignorance.

Writing threads is an exciting part of Java programming because it can free your approach to programming and allow you to think in terms of smaller, independent tasks working in harmony rather than one monolithic application. Along with an understanding of threads-programming, however, comes an awareness of the dark side of threads. The challenges associated with managing thread behavior can be quite thorny and will lead us into an exploration of some of the most mysterious corners of the Java language.




Java For Artists(c) The Art, Philosophy, and Science of Object-Oriented Programming
Java For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504052
EAN: 2147483647
Year: 2007
Pages: 452

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net