0% found this document useful (0 votes)
3 views

Principles of Concurrent and Distributed Programmi... - (Chapter 1 What Is Concurrent Programming)

Uploaded by

sepal23274
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Principles of Concurrent and Distributed Programmi... - (Chapter 1 What Is Concurrent Programming)

Uploaded by

sepal23274
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

i i

i i

4 1 What is Concurrent Programming?

1.3 Multitasking

Multitasking is a simple generalization from the concept of overlapping I/O with a


computation to overlapping the computation of one program with that of another.
Multitasking is the central function of the kernel of all modern operating systems.
A scheduler program is run by the operating system to determine which process
should be allowed to run for the next interval of time. The scheduler can take into
account priority considerations, and usually implements time-slicing, where com-
putations are periodically interrupted to allow a fair sharing of the computational
resources, in particular, of the CPU. You are intimately familiar with multitask-
ing; it enables you to write a document on a word processor while printing another
document and simultaneously downloading a file.
Multitasking has become so useful that modern programming languages support
it within programs by providing constructs for multithreading. Threads enable
the programmer to write concurrent (conceptually parallel) computations within a
single program. For example, interactive programs contain a separate thread for
handling events associated with the user interface that is run concurrently with the
main thread of the computation. It is multithreading that enables you to move the
mouse cursor while a program is performing a computation.

1.4 The terminology of concurrency

The term process is used in the theory of concurrency, while the term thread is
Copyright © 2006. Pearson Education Limited. All rights reserved.

commonly used in programming languages. A technical distinction is often made


between the two terms: a process runs in its own address space managed by the
operating system, while a thread runs within the address space of a single process
and may be managed by a multithreading kernel within the process. The term
thread was popularized by pthreads (POSIX threads), a specification of concur-
rency constructs that has been widely implemented, especially on UNIX systems.
The differences between processes and threads are not relevant for the study of
the synchronization constructs and algorithms, so the term process will be used
throughout, except when discussing threads in the Java language.
The term task is used in the Ada language for what we call a process, and we will
use that term in discussions of the language. The term is also used to denote small
units of work; this usage appears in Chapter 9, as well as in Chapter 13 on real-
time systems where task is the preferred term to denote units of work that are to be
scheduled.

Ben-Ari, M. (2006). Principles of concurrent and distributed programming. Pearson Education Limited.
Created from uql on 2024-07-31 02:58:19.

i i

i i

You might also like