Institute of Computer Science
  1. Courses
  2. 2019/20 spring
  3. Object-Oriented Programming (Narva College) (LTAT.NR.003)
ET
Log in

Object-Oriented Programming (Narva College) 2019/20 spring

  • Home
  • Materials
  • Grading
  • Java Glossary
  • Cheat sheet (S1-S6)
  • Source Example
  • Links
Chapter 13

Thread concepts

One of the powerful features of Java is its built-in support for multithreading. A multithreaded program contains two or more parts that can run concurrently and each part can handle a different task at the same time making optimal use of the available resources especially when a computer has multiple CPUs. Each such part of a program called thread. Threads can be executed simultaneously in multiprocessor systems. In single-processor systems the multiple threads share CPU time, known as time sharing, and the operating system is responsible for scheduling and allocating resources to them.

The advantage of multithreaded programs is that such programs are more responsive and interactive. For example, a good word processor lets us print or save a file while we are typing. In some cases, multithreaded programs run faster than single-threaded programs even on single-processor systems. Java provides exceptionally good support for creating and running threads and for locking resources to prevent conflicts.

Chapter 13
  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment