bab 13

29 Jun

1. What are the three possible levels of concurrency in programs?
instruction, statement, or subprogram level

2. Describe the logical architecture of an SIMD computer.
each processor has its own local memory. One processor controls the operation of
the other processors

3. Describe the logical architecture of an MIMD computer.
Each processor in an MIMD computer executes its own instruction stream. MIMD
computers can appear in two distinct configurations: distributed and shared memory
systems

4. What level of program concurrency is best supported by SIMD
computers?
instruction-level concurrency

5. What level of program concurrency is best supported by MIMD
computers?
unit-level concurrency

6. Describe the logical architecture of a vector processor.
Single-Instruction Multiple-Data (SIMD)

7. What is the difference between physical and logical concurrency?
Physical ->The most natural category of concurrency is that in which, assuming that
more than one processor is available, several program units from the
same program literally execute simultaneously
Logical ->A slight relaxation of this concept of concurrency allows the programmer
and the application software to assume that there are multiple
processors providing actual concurrency, when in fact the actual
execution of programs is taking place in interleaved fashion on a single
processor

8. What is a thread of control in a program?
sequence of program points reached as control flows through the program

9. Why are coroutines called quasi-concurrent?
Because they have a single thread of control

10. What is a multithreaded program?
A program designed to have more than one thread of control

11. What are four reasons for studying language support for concurrency?
The first reason is the speed of execution of programs on machines with multiple
processors.
The second reason is that even when a machine has just one processor, a
program written to use concurrent execution can be faster than the same program
written for sequential (nonconcurrent) execution.
The third reason is that concurrency provides a different method of conceptualizing
program solutions to problems.
The fourth reason for using concurrency is to program applications that
are distributed over several machines, either locally or through the Internet.

12. What is a heavyweight task? What is a lightweight task?
Heavyweight task executes in its own address space.
Lightweight tasks all run in the same address space.

14. What kind of tasks do not require any kind of synchronization?
disjoint

15. Describe the five different states in which a task can be.
1. New: A task is in the new state when it has been created but has not yet
begun its execution.
2. Ready: A ready task is ready to run but is not currently running. Either
it has not been given processor time by the scheduler, or it had run
previously but was blocked in one of the ways described in Paragraph 4
of this subsection. Tasks that are ready to run are stored in a queue
that is often called the task ready queue.
3. Running: A running task is one that is currently executing; that is, it has
a processor and its code is being executed.
4. Blocked: A task that is blocked has been running, but that execution was
interrupted by one of several different events, the most common of
which is an input or output operation. In addition to input and output,
some languages provide operations for the user program to specify that
a task is to be blocked.
5. Dead: A dead task is no longer active in any sense. A task dies when

Problem Set

1. Explain clearly why competition synchronization is not a problem
in a programming environment that supports coroutines but not
concurrency.
Competition synchronization prevents two tasks from accessing a shared
data structure at exactly the same time—a situation that could destroy the
integrity of that shared data.

2. What is the best action a system can take when deadlock is detected?
Debug it

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: