12 Threads in Java

12.1 INTRODUCTION

Running multiple programs/task on a computer is termed as multitasking. For example, running an MS-Word application and Visual C++ application at the same time is an example of multitasking. Each running instance of a program in memory is known as a process. Each process has a single unit of execution which is a thread. Thus, running multiple programs from user's point of view is multitasking, but from operating system's point of view, it is multithreading, which is also known as concurrent programming.

A process has a self-contained execution environment. A process generally has a complete, private set of basic run-time resources; in particular, each process has its own memory space. A multitasking operating ...

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.