0% found this document useful (0 votes)
1K views184 pages

CS0051 Sa1 Sa2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views184 pages

CS0051 Sa1 Sa2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 184

[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.

com/courses/83484/quizzes/999882

[S1 - SUMMATIVE ASSESSMENT] Module 1 and


Module 2
Due Jun 2 at 11:59pm Points 50 Questions 50
Available May 29 at 12am - Jun 2 at 11:59pm Time Limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help
in this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in
my environment.

General Direction: Answer the following questions by selecting the letter that corresponds to the
correct answer.

Export Questions 

Attempt History
Attempt Time Score

LATEST Attempt 1  35 minutes 43 out of 50

Score for this quiz: 43 out of 50


Submitted Jun 1 at 12:27pm
This attempt took 35 minutes.

1 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Question 1 0 / 1 pts

Which hardware component is responsible for dividing a program into


smaller tasks that can be executed concurrently?

Memory

Cache

You Answered CPU

Correct Answer GPU

Question 2 1 / 1 pts

What does it mean when a processor has multiple cores?

It can execute multiple programs simultaneously.

It can execute multiple processes simultaneously.

Correct!
It can execute multiple threads simultaneously.

It can execute multiple instructions per clock cycle.

Question 3 1 / 1 pts

2 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Which metric measures the efficiency of parallel processing by


comparing the time taken for a given workload on a single processor
versus multiple processors?

Amdahl's Law

Scalability

Speedup

Correct!
Efficiency

Question 4 1 / 1 pts

Which of the following is an example of a concurrent programming


paradigm?

Procedural programming

Functional programming

Object-oriented programming

Correct!
Event-driven programming

Question 5 1 / 1 pts

Which of the following is a characteristic of a deadlock situation?

3 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Correct!
A thread waits indefinitely for a resource.

A thread accesses a shared resource without proper synchronization.

Two or more threads continuously compete for a resource.

A thread incorrectly modifies shared data.

Question 6 1 / 1 pts

In the context of concurrent programming, what is the purpose of


deadlock detection?

To prevent race conditions.

To resolve deadlock situations automatically.

Correct!
To detect potential deadlock situations and take corrective action.

To schedule threads for execution on different processors.

Question 7 1 / 1 pts

Which of the following statements is true regarding thread-local storage


(TLS)?

Correct!
It provides a separate memory region for each thread.

4 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

It allows inter-process communication.

It eliminates the need for mutual exclusion mechanisms.

It allows multiple threads to access the same shared memory region.

Question 8 1 / 1 pts

Which of the following statements is true regarding thread


synchronization?

Synchronization is necessary only when shared resources are involved.

Synchronization can be achieved without the use of locks or


semaphores

Correct!

Synchronization can improve the performance of concurrent programs.

Synchronization guarantees deadlock-free execution.

Question 9 1 / 1 pts

What is the purpose of SIMD (Single Instruction, Multiple Data)


instructions in parallel computing?

5 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

To allow multiple processes to share the same memory space.

To enable multiple threads to execute in parallel.

Correct!
To perform the same operation on multiple data elements
simultaneously.

To synchronize the execution of multiple threads.

Question 10 1 / 1 pts

Which of the following synchronization mechanisms provides the


highest level of concurrency among threads?

Semaphore

Correct!
Read-write lock

Mutex

Barrier

Question 11 0 / 1 pts

What is a critical section in the context of concurrent programming?

A section of code that is protected by a mutex.

6 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Correct Answer A section of code where threads can execute in any order.

You Answered A section of code where only one thread can execute at a time.

A section of code that must be executed atomically.

Question 12 1 / 1 pts

What does it mean when a parallel algorithm exhibits load balancing?

Each processor performs the same amount of work.

The algorithm can be executed on different types of processors.

The algorithm has a low communication overhead.

Correct!
The workload is evenly distributed across multiple processors.

Question 13 1 / 1 pts

What is the purpose of a semaphore in concurrent programming?

To synchronize the execution of threads.

Correct!
o allocate resources to different threads.

To ensure mutual exclusion.

7 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

To allow inter-process communication.

Question 14 1 / 1 pts

What is the purpose of a mutex in concurrent programming?

To schedule threads for execution on different processors.

To allow multiple threads to access a shared resource simultaneously.

To prevent deadlocks in multithreaded programs.

Correct!
To ensure that only one thread can execute a particular section of code
at a time.

Question 15 1 / 1 pts

8 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Which of the following is a characteristic of parallel computing


hardware?

Higher clock speed

Larger cache size

Reduced power consumption

Correct!
Increased number of execution units

Question 16 1 / 1 pts

What is the fundamental unit of execution in a multiprocessing system?

Task

Correct!
Process

Thread

Core

Question 17 1 / 1 pts

In a multithreading environment, what is the main advantage of using


threads over processes?

9 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Correct!
Lower memory consumption

Faster context switching

Increased security

Better resource isolation

Question 18 1 / 1 pts

Which of the following is an example of a mutual exclusion mechanism?

Barrier

Correct!
Lock

Semaphore

Monitor

Question 19 1 / 1 pts

What is the purpose of pipelining in parallel computing?

To improve cache performance.

To reduce the number of execution units required.

Correct!
To overlap the execution of multiple instructions.

10 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

To increase the clock speed of the processor.

Question 20 1 / 1 pts

Which type of memory is often used in parallel computing to store


intermediate results?

Hard disk

Correct!
Cache

Registers

RAM

Question 21 1 / 1 pts

Which metric measures the speedup achieved by executing a program


on multiple processors compared to a single processor?

Correct!
Speedup

Amdahl's Law

Scalability

Efficiency

11 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Question 22 1 / 1 pts

Which synchronization primitive allows multiple threads to access a


shared resource simultaneously, as long as no thread is modifying i

Correct!
Read-write lock

Condition variable

Barrier

Mutex

Question 23 1 / 1 pts

What is the purpose of a memory hierarchy in parallel computing


systems?

To increase the clock speed of the processor.

To enable multi-threading.

Correct!
To improve cache performance.

To reduce power consumption.

Question 24 1 / 1 pts

12 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Which type of parallel computing hardware is characterized by a large


number of relatively simple processing units?

MIMD

Correct!
SIMD

MISD

SISD

Question 25 1 / 1 pts

Which synchronization primitive allows threads to wait until a certain


condition is satisfied before proceeding?

Condition variable

Barrier

Semaphore

Correct!
Lock

Question 26 1 / 1 pts

What is the purpose of thread scheduling in an operating system?

13 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

To assign threads to different processors.

To prevent thread starvation.

Correct!
To allocate processor time to different threads.

To manage thread creation and termination.

Question 27 1 / 1 pts

What is the role of a memory controller in parallel computing systems?

To allocate processor time to different threads.

Correct!
To coordinate the access to shared memory resources.

To manage the flow of data between different processors.

To synchronize the execution of threads

Question 28 1 / 1 pts

Which parallel computing architecture is specifically designed for


accelerating deep learning tasks?

ASIC

Correct!
GPGPU

14 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Quantum computer

FPGA

Question 29 1 / 1 pts

How is data typically exchanged between different processors in a


parallel computing system?

Through cache coherence protocols

Correct!
Through message passing

Through direct memory access

Through shared memory

Question 30 1 / 1 pts

Which of the following is an example of a parallel computing


architecture that uses a shared memory model?

Message passing interface (MPI)

Correct!
OpenMP

MapReduce

CUDA

15 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Question 31 1 / 1 pts

Distributed processing is the term used for simultaneous access to a resource,


physical or logical.

True

Correct!
False

Question 32 1 / 1 pts

Threads being blocked altogether and being executed in the sets of 32 threads
are called Unit Blocks.

True

Correct!
False

Question 33 1 / 1 pts

Parallelism naturally leads to concurrency.

Correct!
True

False

16 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Question 34 0 / 1 pts

The on-chip memory which is local to every multithreaded Single


Instruction Single Data (SISD) Processor is called local memory.

You Answered True

Correct Answer False

Question 35 0 / 1 pts

Parallelism naturally leads to complexity.

You Answered True

Correct Answer False

Question 36 1 / 1 pts

The four classifications of Flynn's Taxonomy are based on the number


of concurrent memory streams and I/O streams available in the
architecture.

True

Correct!
False

17 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Question 37 1 / 1 pts

An SMP system has two or more iden�cal processors which are connected to a
single shared memory o�en through a system bus.

Correct!
True

False

Question 38 1 / 1 pts

UMA stands for Uniform Memory Access.

Correct!
True

False

Question 39 1 / 1 pts

The four classifications of Flynn's Taxonomy are based on the number


of concurrent instruction streams and I/O streams available in the
architecture.

Correct!
True

False

18 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

Question 40 1 / 1 pts

In a concurrent memory architecture, each processor operates


independently, and cannot make changes to its local memory.

True

Correct!
False

Question 41 1 / 1 pts

It is good to use daemon threads to handle continuous background


tasks because they will not prevent the program from terminating when
the main thread is finished.

Correct!
True

False

Question 42 1 / 1 pts

What two states do Java threads have in addition to the standard four
thread states? (NEW, RUNNABLE, BLOCKED, TERMINATED)

BLOCKABLE and EXECUTABLE

RUNNING and FINISHED

Correct!
WAITING and TIMED_WAITING

19 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

RUNNING and DESTROYED

Question 43 0 / 1 pts

A thread that calls the join method on another thread will enter the new
state until the other thread finishes executing.

You Answered
True

Correct Answer
False

Question 44 1 / 1 pts

When defining a new Java class, the class can implement one other
interface, which is not an advantage of implementing Java's Runnable
interface rather than inheriting from the Thread class and overriding the
run() method.

True

Correct!
False

Question 45 0 / 1 pts

Concurrent tasks execute at the same time.

20 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

You Answered True

Correct Answer False

Question 46 1 / 1 pts

The operating system assigns each process a unique number of


threads.

True

Correct!
False

Question 47 1 / 1 pts

Processes are simpler to communicate between than threads.

True

Correct!
False

Question 48 1 / 1 pts

A _____ contains one or more _____.

Correct!
process; threads

21 of 22 6/1/2023, 12:28
[S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999882

thread; other threads

thread; processes

process; other processes

Question 49 0 / 1 pts

What is the number of binary recursion given an input arr = { 2, 5, 7, 99,


899 } and key = 899?

You Answered the same JVM thread

Correct Answer separate JVM processes

separate JVM threads

the same JVM process

Question 50 1 / 1 pts

A process contains one or more other processes.

True

Correct!
False

Quiz Score: 43 out of 50

22 of 22 6/1/2023, 12:28
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

[S1 - SUMMATIVE ASSESSMENT] Module 1 and


Module 2
Due 2 Jun at 23:59 Points 50 Questions 50
Available 29 May at 0:00 - 2 Jun at 23:59 Time limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help in
this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in my
environment.

General Direction: Answer the following questions by selecting the letter that corresponds to the correct
answer.

Export Questions 

Attempt history
Attempt Time Score

LATEST Attempt 1  27 minutes 43 out of 50

Score for this quiz: 43 out of 50


Submitted 1 Jun at 2:34
This attempt took 27 minutes.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 1/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 1 0 / 1 pts

Which hardware component is responsible for dividing a program into


smaller tasks that can be executed concurrently?

orrect answer GPU

Cache

ou Answered CPU

Memory

Question 2 1 / 1 pts

What does it mean when a processor has multiple cores?

It can execute multiple instructions per clock cycle.

Correct! It can execute multiple threads simultaneously.

It can execute multiple processes simultaneously.

It can execute multiple programs simultaneously.

Question 3 1 / 1 pts

Which type of memory is often used in parallel computing to store


intermediate results?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 2/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Registers

RAM

Hard disk

Correct! Cache

Question 4 1 / 1 pts

What does it mean when a parallel algorithm exhibits load balancing?

Each processor performs the same amount of work.

The algorithm has a low communication overhead.

Correct! The workload is evenly distributed across multiple processors.

The algorithm can be executed on different types of processors.

Question 5 1 / 1 pts

What is the purpose of thread scheduling in an operating system?

To prevent thread starvation.

Correct! To allocate processor time to different threads.

To manage thread creation and termination.

To assign threads to different processors.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 3/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 6 0 / 1 pts

Which metric measures the efficiency of parallel processing by comparing


the time taken for a given workload on a single processor versus multiple
processors?

ou Answered Speedup

Scalability

orrect answer Efficiency

Amdahl's Law

Question 7 1 / 1 pts

What is the purpose of pipelining in parallel computing?

To increase the clock speed of the processor.

To improve cache performance.

To reduce the number of execution units required.

Correct! To overlap the execution of multiple instructions.

Question 8 0 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 4/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

In a multithreading environment, what is the main advantage of using


threads over processes?

Better resource isolation

Increased security

orrect answer Lower memory consumption

ou Answered Faster context switching

Question 9 1 / 1 pts

Which metric measures the speedup achieved by executing a program on


multiple processors compared to a single processor?

Efficiency

Scalability

Correct! Speedup

Amdahl's Law

Question 10 1 / 1 pts

Which of the following is an example of a concurrent programming


paradigm?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 5/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! Event-driven programming

Functional programming

Procedural programming

Object-oriented programming

Question 11 1 / 1 pts

How is data typically exchanged between different processors in a parallel


computing system?

Correct! Through message passing

Through direct memory access

Through cache coherence protocols

Through shared memory

Question 12 0 / 1 pts

Which synchronization primitive allows threads to wait until a certain


condition is satisfied before proceeding?

orrect answer Lock

ou Answered Condition variable

https://feucanvas.instructure.com/courses/83484/quizzes/999882 6/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Barrier

Semaphore

Question 13 0 / 1 pts

What is the purpose of a semaphore in concurrent programming?

To allow inter-process communication.

To ensure mutual exclusion.

ou Answered To synchronize the execution of threads.

orrect answer o allocate resources to different threads.

Question 14 1 / 1 pts

In the context of concurrent programming, what is the purpose of


deadlock detection?

Correct! To detect potential deadlock situations and take corrective action.

To resolve deadlock situations automatically.

To schedule threads for execution on different processors.

To prevent race conditions.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 7/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 15 1 / 1 pts

What is the purpose of a mutex in concurrent programming?

To prevent deadlocks in multithreaded programs.

To allow multiple threads to access a shared resource simultaneously.

To schedule threads for execution on different processors.

Correct!
To ensure that only one thread can execute a particular section of code at
a time.

Question 16 0 / 1 pts

What is a critical section in the context of concurrent programming?

A section of code that is protected by a mutex.

ou Answered A section of code where only one thread can execute at a time.

A section of code that must be executed atomically.

orrect answer A section of code where threads can execute in any order.

Question 17 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 8/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Which of the following is a characteristic of parallel computing hardware?

Correct! Increased number of execution units

Reduced power consumption

Higher clock speed

Larger cache size

Question 18 1 / 1 pts

What is the purpose of SIMD (Single Instruction, Multiple Data)


instructions in parallel computing?

To enable multiple threads to execute in parallel.

To synchronize the execution of multiple threads.

To allow multiple processes to share the same memory space.

Correct!

To perform the same operation on multiple data elements simultaneously.

Question 19 1 / 1 pts

What is the role of a memory controller in parallel computing systems?

Correct! To coordinate the access to shared memory resources.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 9/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

To synchronize the execution of threads

To allocate processor time to different threads.

To manage the flow of data between different processors.

Question 20 1 / 1 pts

Which of the following statements is true regarding thread


synchronization?

Correct! Synchronization can improve the performance of concurrent programs.

Synchronization guarantees deadlock-free execution.

Synchronization is necessary only when shared resources are involved.

Synchronization can be achieved without the use of locks or semaphores

Question 21 1 / 1 pts

Which of the following synchronization mechanisms provides the highest


level of concurrency among threads?

Mutex

Barrier

Semaphore

https://feucanvas.instructure.com/courses/83484/quizzes/999882 10/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! Read-write lock

Question 22 1 / 1 pts

Which parallel computing architecture is specifically designed for


accelerating deep learning tasks?

Correct! GPGPU

FPGA

Quantum computer

ASIC

Question 23 1 / 1 pts

What is the purpose of a memory hierarchy in parallel computing


systems?

Correct! To improve cache performance.

To reduce power consumption.

To increase the clock speed of the processor.

To enable multi-threading.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 11/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 24 0 / 1 pts

Which of the following is a characteristic of a deadlock situation?

A thread accesses a shared resource without proper synchronization.

orrect answer A thread waits indefinitely for a resource.

ou Answered Two or more threads continuously compete for a resource.

A thread incorrectly modifies shared data.

Question 25 1 / 1 pts

Which of the following statements is true regarding thread-local storage


(TLS)?

It allows inter-process communication.

Correct! It provides a separate memory region for each thread.

It eliminates the need for mutual exclusion mechanisms.

It allows multiple threads to access the same shared memory region.

Question 26 1 / 1 pts

What is the fundamental unit of execution in a multiprocessing system?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 12/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Task

Thread

Correct! Process

Core

Question 27 1 / 1 pts

Which synchronization primitive allows multiple threads to access a


shared resource simultaneously, as long as no thread is modifying i

Mutex

Barrier

Condition variable

Correct! Read-write lock

Question 28 1 / 1 pts

Which of the following is an example of a parallel computing architecture


that uses a shared memory model?

CUDA

Message passing interface (MPI)

Correct! OpenMP

https://feucanvas.instructure.com/courses/83484/quizzes/999882 13/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

MapReduce

Question 29 1 / 1 pts

Which type of parallel computing hardware is characterized by a large


number of relatively simple processing units?

MISD

MIMD

SISD

Correct! SIMD

Question 30 1 / 1 pts

Which of the following is an example of a mutual exclusion mechanism?

Correct! Lock

Semaphore

Monitor

Barrier

Question 31 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 14/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

A Symmetric Multi-Processing (SMP) system has two or more dissimilar


processors connected to a single shared main memory.

True

Correct! False

Question 32 1 / 1 pts

The tightly coupled set of threads' execution working on a single task is


called Distributed Processing.

True

Correct! False

Question 33 1 / 1 pts

In most modern multi-core CPUs, cache coherency is usually handled by


the application software.

True

Correct! False

Question 34 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 15/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

A key advantage of distributed memory architectures is that they are


more scalable than shared memory systems.

Correct! True

False

Question 35 1 / 1 pts

Multiple-applications dependently running, are typically called


Multithreading.

True

Correct! False

Question 36 1 / 1 pts

Shared memory scales better than Distributed memory.

True

Correct! False

Question 37 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 16/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

An SMP system has two or more identical processors which are connected to a
single shared memory often through a system bus.

Correct! True

False

Question 38 1 / 1 pts

Parallel computing can increase the speed at which a program executes a


set number of tasks.

Correct! True

False

Question 39 1 / 1 pts

Modern multi-core PCs fall into the SISD classification of Flynn's


Taxonomy.

True

Correct! False

https://feucanvas.instructure.com/courses/83484/quizzes/999882 17/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 40 1 / 1 pts

UMA stands for Uniform Memory Access.

Correct! True

False

Question 41 1 / 1 pts

You can safely expect threads to execute in the same relative order that
you create them.

True

Correct! False

Question 42 1 / 1 pts

In most operating systems, the user determines when each of the threads
and processes gets scheduled to execute.

True

Correct! False

Question 43 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 18/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

When defining a new Java class, the class can implement multiple other
interfaces, which is not an advantage of implementing Java's Runnable
interface rather than inheriting from the Thread class and overriding the
run() method.

True

Correct! False

Question 44 1 / 1 pts

A thread that calls the join method on another thread will enter the
blocked state until the other thread finishes executing.

Correct! True

False

Question 45 1 / 1 pts

It is possible for two tasks to execute in parallel using a single-core


processor.

True

Correct! False

Question 46 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 19/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

A process contains one or more other processes.

True

Correct! False

Question 47 1 / 1 pts

Processes are faster to switch between than threads.

True

Correct! False

Question 48 1 / 1 pts

If Thread A calls the lock() method on a Lock that is already possessed by


Thread B, Thread A will immediately take possession of the Lock from
Thread B.

True

Correct! False

Question 49 1 / 1 pts

You should avoid using Java's synchronized statement on an immutable


object such as an Integer because Java will throw a compilation error.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 20/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

True

Correct! False

Question 50 1 / 1 pts

Every thread is independent and has its own separate address space in
memory.

True

Correct! False

Quiz score: 43 out of 50

https://feucanvas.instructure.com/courses/83484/quizzes/999882 21/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

[S1 - SUMMATIVE ASSESSMENT] Module 1 and


Module 2
Due Jun 2 at 11:59pm Points 50 Questions 50
Available May 29 at 12am - Jun 2 at 11:59pm Time Limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help in
this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in my
environment.

General Direction: Answer the following questions by selecting the letter that corresponds to the correct
answer.

Export Questions 

Attempt History
Attempt Time Score

LATEST Attempt 1  32 minutes 46 out of 50

Score for this quiz: 46 out of 50


Submitted Jun 2 at 5:23pm
This attempt took 32 minutes.

https://feu.instructure.com/courses/83484/quizzes/999882 1/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 1 1 / 1 pts

Which hardware component is responsible for dividing a program into


smaller tasks that can be executed concurrently?

Memory

Correct! GPU

CPU

Cache

Question 2 1 / 1 pts

What does it mean when a processor has multiple cores?

It can execute multiple programs simultaneously.

It can execute multiple processes simultaneously.

Correct! It can execute multiple threads simultaneously.

It can execute multiple instructions per clock cycle.

Question 3 1 / 1 pts

Which metric measures the efficiency of parallel processing by


comparing the time taken for a given workload on a single processor
versus multiple processors?
https://feu.instructure.com/courses/83484/quizzes/999882 2/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! Efficiency

Speedup

Scalability

Amdahl's Law

Question 4 1 / 1 pts

Which metric measures the speedup achieved by executing a program on


multiple processors compared to a single processor?

Amdahl's Law

Scalability

Efficiency

Correct! Speedup

Question 5 1 / 1 pts

What is the purpose of pipelining in parallel computing?

Correct! To overlap the execution of multiple instructions.

To increase the clock speed of the processor.

To reduce the number of execution units required.

https://feu.instructure.com/courses/83484/quizzes/999882 3/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

To improve cache performance.

Question 6 1 / 1 pts

Which type of parallel computing hardware is characterized by a large


number of relatively simple processing units?

Correct! SIMD

MISD

MIMD

SISD

Question 7 1 / 1 pts

In the context of concurrent programming, what is the purpose of


deadlock detection?

Correct! To detect potential deadlock situations and take corrective action.

To resolve deadlock situations automatically.

To schedule threads for execution on different processors.

To prevent race conditions.

https://feu.instructure.com/courses/83484/quizzes/999882 4/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 8 1 / 1 pts

Which of the following is an example of a concurrent programming


paradigm?

Functional programming

Procedural programming

Object-oriented programming

Correct! Event-driven programming

Question 9 1 / 1 pts

What is the purpose of thread scheduling in an operating system?

To manage thread creation and termination.

Correct! To allocate processor time to different threads.

To assign threads to different processors.

To prevent thread starvation.

Question 10 1 / 1 pts

Which synchronization primitive allows threads to wait until a certain


condition is satisfied before proceeding?

https://feu.instructure.com/courses/83484/quizzes/999882 5/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Barrier

Correct! Lock

Semaphore

Condition variable

Question 11 1 / 1 pts

In a multithreading environment, what is the main advantage of using


threads over processes?

Increased security

Better resource isolation

Faster context switching

Correct! Lower memory consumption

Question 12 1 / 1 pts

Which of the following is a characteristic of parallel computing hardware?

Reduced power consumption

Larger cache size

Higher clock speed

https://feu.instructure.com/courses/83484/quizzes/999882 6/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! Increased number of execution units

Question 13 1 / 1 pts

What does it mean when a parallel algorithm exhibits load balancing?

Each processor performs the same amount of work.

Correct! The workload is evenly distributed across multiple processors.

The algorithm has a low communication overhead.

The algorithm can be executed on different types of processors.

Question 14 1 / 1 pts

What is the purpose of a semaphore in concurrent programming?

To synchronize the execution of threads.

To allow inter-process communication.

Correct! o allocate resources to different threads.

To ensure mutual exclusion.

Question 15 1 / 1 pts

https://feu.instructure.com/courses/83484/quizzes/999882 7/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Which synchronization primitive allows multiple threads to access a


shared resource simultaneously, as long as no thread is modifying i

Correct! Read-write lock

Condition variable

Mutex

Barrier

Question 16 1 / 1 pts

What is a critical section in the context of concurrent programming?

A section of code that is protected by a mutex.

A section of code that must be executed atomically.

A section of code where only one thread can execute at a time.

Correct! A section of code where threads can execute in any order.

Question 17 1 / 1 pts

What is the purpose of a mutex in concurrent programming?

To prevent deadlocks in multithreaded programs.

https://feu.instructure.com/courses/83484/quizzes/999882 8/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

To allow multiple threads to access a shared resource simultaneously.

To schedule threads for execution on different processors.

Correct!
To ensure that only one thread can execute a particular section of code at
a time.

Question 18 1 / 1 pts

What is the purpose of SIMD (Single Instruction, Multiple Data)


instructions in parallel computing?

To allow multiple processes to share the same memory space.

To enable multiple threads to execute in parallel.

To synchronize the execution of multiple threads.

Correct!

To perform the same operation on multiple data elements simultaneously.

Question 19 1 / 1 pts

Which of the following statements is true regarding thread-local storage


(TLS)?

It allows inter-process communication.

It allows multiple threads to access the same shared memory region.

https://feu.instructure.com/courses/83484/quizzes/999882 9/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! It provides a separate memory region for each thread.

It eliminates the need for mutual exclusion mechanisms.

Question 20 1 / 1 pts

What is the purpose of a memory hierarchy in parallel computing


systems?

To increase the clock speed of the processor.

Correct! To improve cache performance.

To reduce power consumption.

To enable multi-threading.

Question 21 1 / 1 pts

Which parallel computing architecture is specifically designed for


accelerating deep learning tasks?

Quantum computer

ASIC

Correct! GPGPU

FPGA

https://feu.instructure.com/courses/83484/quizzes/999882 10/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 22 1 / 1 pts

Which of the following is a characteristic of a deadlock situation?

Two or more threads continuously compete for a resource.

A thread incorrectly modifies shared data.

A thread accesses a shared resource without proper synchronization.

Correct! A thread waits indefinitely for a resource.

Question 23 1 / 1 pts

Which of the following statements is true regarding thread


synchronization?

Correct! Synchronization can improve the performance of concurrent programs.

Synchronization can be achieved without the use of locks or semaphores

Synchronization is necessary only when shared resources are involved.

Synchronization guarantees deadlock-free execution.

Question 24 1 / 1 pts

https://feu.instructure.com/courses/83484/quizzes/999882 11/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Which of the following is an example of a parallel computing architecture


that uses a shared memory model?

Correct! OpenMP

MapReduce

Message passing interface (MPI)

CUDA

Question 25 1 / 1 pts

What is the fundamental unit of execution in a multiprocessing system?

Task

Thread

Core

Correct! Process

Question 26 1 / 1 pts

How is data typically exchanged between different processors in a parallel


computing system?

Through cache coherence protocols


https://feu.instructure.com/courses/83484/quizzes/999882 12/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Through shared memory

Through direct memory access

Correct! Through message passing

Question 27 1 / 1 pts

What is the role of a memory controller in parallel computing systems?

To synchronize the execution of threads

To manage the flow of data between different processors.

To allocate processor time to different threads.

Correct! To coordinate the access to shared memory resources.

Question 28 1 / 1 pts

Which of the following is an example of a mutual exclusion mechanism?

Barrier

Monitor

Semaphore

Correct! Lock

https://feu.instructure.com/courses/83484/quizzes/999882 13/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 29 1 / 1 pts

Which type of memory is often used in parallel computing to store


intermediate results?

RAM

Hard disk

Correct! Cache

Registers

Question 30 1 / 1 pts

Which of the following synchronization mechanisms provides the highest


level of concurrency among threads?

Mutex

Correct! Read-write lock

Barrier

Semaphore

Question 31 0 / 1 pts

A Symmetric Multi-Processing (SMP) system has two or more identical


processors connected to a single distributed main memory.
https://feu.instructure.com/courses/83484/quizzes/999882 14/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

ou Answered True

orrect Answer False

Question 32 1 / 1 pts

In parallel processing, several instructions are executed simultaneously.

Correct! True

False

Question 33 1 / 1 pts

A key advantage of distributed memory architectures is that they are


_____ than shared memory systems.

more responsive

less complex

easier to program for

Correct! more scalable

Question 34 1 / 1 pts

https://feu.instructure.com/courses/83484/quizzes/999882 15/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

The tightly coupled set of threads' execution working on a single task is


called Distributed Processing.

True

Correct! False

Question 35 0 / 1 pts

Distributed processing is the term used for simultaneous access to a resource,


physical or logical.

ou Answered True

orrect Answer False

Question 36 1 / 1 pts

Computer memory usually operates at a much faster speed than


processors do.

True

Correct! False

Question 37 1 / 1 pts

Computer memory usually operates at a much slower speed than processors do.
https://feu.instructure.com/courses/83484/quizzes/999882 16/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! True

False

Question 38 0 / 1 pts

Distributed memory can be easily scaled.

orrect Answer True

ou Answered False

Question 39 1 / 1 pts

Shared memory doesn't necessarily mean all of the data exists on the same
physical device, hence it could be spread across a cluster of systems.

Correct! True

False

Question 40 1 / 1 pts

Shared memory always scales well.

True

Correct! False

https://feu.instructure.com/courses/83484/quizzes/999882 17/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 41 1 / 1 pts

If a daemon thread in Java creates another thread, that child thread will
only be a daemon thread if its parent calls the setDaemon() method
before starting it

True

Correct! False

Question 42 1 / 1 pts

It can be risky to use a daemon thread to perform a task that involves


writing data to a log file because the log file could end up with multiple,
duplicate entries.

True

Correct! False

Question 43 1 / 1 pts

When defining a new Java class, the class can implement multiple other
interfaces, which is not an advantage of implementing Java's Runnable
interface rather than inheriting from the Thread class and overriding the
run() method.

True

https://feu.instructure.com/courses/83484/quizzes/999882 18/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! False

Question 44 1 / 1 pts

If a daemon thread in Java creates another thread, that child thread


will inherit the daemon status of its parent thread.

Correct! True

False

Question 45 1 / 1 pts

A thread that calls the join method on another thread will enter the
blocked state until the other thread finishes executing.

Correct! True

False

Question 46 1 / 1 pts

Java's Atomic variable classes are unique because their values update as
a single, uninterrupted operation which makes them "thread-safe."

Correct! True

False

https://feu.instructure.com/courses/83484/quizzes/999882 19/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 47 1 / 1 pts

The operating system assigns each process a unique CPU core.

True

Correct! False

Question 48 1 / 1 pts

The operating system assigns each process a unique process ID number.

Correct! True

False

Question 49 1 / 1 pts

If Thread A calls the lock() method on a Lock that is already possessed by


Thread B, Thread A and Thread B will both possess the Lock.

True

Correct! False

Question 50 0 / 1 pts

https://feu.instructure.com/courses/83484/quizzes/999882 20/21
6/2/23, 5:24 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

If one thread opens a file with read privileges then other threads in another
process can also read from that file.

ou Answered True

orrect Answer False

Quiz Score: 46 out of 50

https://feu.instructure.com/courses/83484/quizzes/999882 21/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

[S1 - SUMMATIVE ASSESSMENT] Module 1 and


Module 2
Due 2 Jun at 23:59 Points 50 Questions 50
Available 29 May at 0:00 - 2 Jun at 23:59 Time limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help in
this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in my
environment.

General Direction: Answer the following questions by selecting the letter that corresponds to the correct
answer.

Export Questions 

Attempt history
Attempt Time Score

LATEST Attempt 1  34 minutes 46 out of 50

Score for this quiz: 46 out of 50


Submitted 1 Jun at 22:14
This attempt took 34 minutes.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 1/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 1 1 / 1 pts

Which hardware component is responsible for dividing a program into


smaller tasks that can be executed concurrently?

CPU

Correct! GPU

Cache

Memory

Question 2 1 / 1 pts

What does it mean when a processor has multiple cores?

It can execute multiple programs simultaneously.

It can execute multiple processes simultaneously.

It can execute multiple instructions per clock cycle.

Correct! It can execute multiple threads simultaneously.

Question 3 1 / 1 pts

How is data typically exchanged between different processors in a parallel


computing system?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 2/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Through cache coherence protocols

Correct! Through message passing

Through shared memory

Through direct memory access

Question 4 1 / 1 pts

Which metric measures the efficiency of parallel processing by comparing


the time taken for a given workload on a single processor versus multiple
processors?

Speedup

Scalability

Amdahl's Law

Correct! Efficiency

Question 5 1 / 1 pts

Which of the following synchronization mechanisms provides the highest


level of concurrency among threads?

Correct! Read-write lock

Barrier

https://feucanvas.instructure.com/courses/83484/quizzes/999882 3/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Mutex

Semaphore

Question 6 1 / 1 pts

Which type of parallel computing hardware is characterized by a large


number of relatively simple processing units?

MISD

MIMD

SISD

Correct! SIMD

Question 7 1 / 1 pts

Which of the following is an example of a concurrent programming


paradigm?

Functional programming

Procedural programming

Object-oriented programming

Correct! Event-driven programming

https://feucanvas.instructure.com/courses/83484/quizzes/999882 4/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 8 1 / 1 pts

In the context of concurrent programming, what is the purpose of


deadlock detection?

To schedule threads for execution on different processors.

Correct! To detect potential deadlock situations and take corrective action.

To resolve deadlock situations automatically.

To prevent race conditions.

Question 9 1 / 1 pts

What is the purpose of pipelining in parallel computing?

To reduce the number of execution units required.

Correct! To overlap the execution of multiple instructions.

To increase the clock speed of the processor.

To improve cache performance.

Question 10 1 / 1 pts

What is the fundamental unit of execution in a multiprocessing system?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 5/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! Process

Core

Thread

Task

Question 11 1 / 1 pts

What does it mean when a parallel algorithm exhibits load balancing?

Each processor performs the same amount of work.

The algorithm can be executed on different types of processors.

Correct! The workload is evenly distributed across multiple processors.

The algorithm has a low communication overhead.

Question 12 1 / 1 pts

Which synchronization primitive allows multiple threads to access a


shared resource simultaneously, as long as no thread is modifying i

Mutex

Condition variable

Correct! Read-write lock

https://feucanvas.instructure.com/courses/83484/quizzes/999882 6/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Barrier

Question 13 1 / 1 pts

Which of the following statements is true regarding thread


synchronization?

Correct! Synchronization can improve the performance of concurrent programs.

Synchronization guarantees deadlock-free execution.

Synchronization is necessary only when shared resources are involved.

Synchronization can be achieved without the use of locks or semaphores

Question 14 1 / 1 pts

Which metric measures the speedup achieved by executing a program on


multiple processors compared to a single processor?

Efficiency

Correct! Speedup

Scalability

Amdahl's Law

https://feucanvas.instructure.com/courses/83484/quizzes/999882 7/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 15 1 / 1 pts

What is the purpose of a memory hierarchy in parallel computing


systems?

To enable multi-threading.

Correct! To improve cache performance.

To reduce power consumption.

To increase the clock speed of the processor.

Question 16 1 / 1 pts

What is the purpose of a semaphore in concurrent programming?

To synchronize the execution of threads.

To ensure mutual exclusion.

To allow inter-process communication.

Correct! o allocate resources to different threads.

Question 17 1 / 1 pts

What is the role of a memory controller in parallel computing systems?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 8/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

To allocate processor time to different threads.

To synchronize the execution of threads

To manage the flow of data between different processors.

Correct! To coordinate the access to shared memory resources.

Question 18 1 / 1 pts

What is the purpose of SIMD (Single Instruction, Multiple Data)


instructions in parallel computing?

Correct!

To perform the same operation on multiple data elements simultaneously.

To allow multiple processes to share the same memory space.

To enable multiple threads to execute in parallel.

To synchronize the execution of multiple threads.

Question 19 1 / 1 pts

Which of the following is a characteristic of a deadlock situation?

Correct! A thread waits indefinitely for a resource.

A thread incorrectly modifies shared data.

Two or more threads continuously compete for a resource.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 9/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

A thread accesses a shared resource without proper synchronization.

Question 20 1 / 1 pts

What is the purpose of thread scheduling in an operating system?

To prevent thread starvation.

To manage thread creation and termination.

To assign threads to different processors.

Correct! To allocate processor time to different threads.

Question 21 1 / 1 pts

Which of the following is an example of a parallel computing architecture


that uses a shared memory model?

MapReduce

Correct! OpenMP

CUDA

Message passing interface (MPI)

Question 22 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 10/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

In a multithreading environment, what is the main advantage of using


threads over processes?

Correct! Lower memory consumption

Better resource isolation

Increased security

Faster context switching

Question 23 1 / 1 pts

Which of the following is a characteristic of parallel computing hardware?

Larger cache size

Correct! Increased number of execution units

Reduced power consumption

Higher clock speed

Question 24 1 / 1 pts

Which of the following is an example of a mutual exclusion mechanism?

Correct! Lock

https://feucanvas.instructure.com/courses/83484/quizzes/999882 11/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Semaphore

Barrier

Monitor

Question 25 1 / 1 pts

What is the purpose of a mutex in concurrent programming?

To allow multiple threads to access a shared resource simultaneously.

To prevent deadlocks in multithreaded programs.

To schedule threads for execution on different processors.

Correct!
To ensure that only one thread can execute a particular section of code at
a time.

Question 26 1 / 1 pts

Which parallel computing architecture is specifically designed for


accelerating deep learning tasks?

ASIC

Correct! GPGPU

Quantum computer

https://feucanvas.instructure.com/courses/83484/quizzes/999882 12/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

FPGA

Question 27 1 / 1 pts

What is a critical section in the context of concurrent programming?

A section of code that must be executed atomically.

A section of code where only one thread can execute at a time.

A section of code that is protected by a mutex.

Correct! A section of code where threads can execute in any order.

Question 28 1 / 1 pts

Which of the following statements is true regarding thread-local storage


(TLS)?

It eliminates the need for mutual exclusion mechanisms.

It allows multiple threads to access the same shared memory region.

Correct! It provides a separate memory region for each thread.

It allows inter-process communication.

Question 29 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 13/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Which type of memory is often used in parallel computing to store


intermediate results?

Hard disk

Correct! Cache

RAM

Registers

Question 30 1 / 1 pts

Which synchronization primitive allows threads to wait until a certain


condition is satisfied before proceeding?

Barrier

Correct! Lock

Semaphore

Condition variable

Question 31 1 / 1 pts

The on-chip memory which is local to every multithreaded Single


Instruction Single Data (SISD) Processor is called local memory.

True

https://feucanvas.instructure.com/courses/83484/quizzes/999882 14/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! False

Question 32 1 / 1 pts

Parallel processing refers to the execution of activities at the same time.

Correct! True

False

Question 33 1 / 1 pts

Threads being blocked altogether and being executed in the sets of 2


threads are called Unit Blocks.

True

Correct! False

Question 34 1 / 1 pts

Shared data is used by a multi-processor.

Correct! True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999882 15/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 35 1 / 1 pts

The tightly coupled set of threads' execution working on multiple task is


called Parallel Processing.

True

Correct! False

Question 36 1 / 1 pts

Computer memory usually operates at a much faster speed than


processors do.

True

Correct! False

Question 37 1 / 1 pts

Each core of modern processors' has a separate cache that stores frequently
accessed data.

Correct! True

False

Question 38 0 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 16/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Parallel computing can increase the _____.

number of tasks a program executes in a set time

orrect answer all of these answers

ou Answered speed at which a program executes a set number of tasks

scale of problems a program can tackle

Question 39 0 / 1 pts

In a parallel memory architecture, each processor operates


independently, and if it makes changes to its local memory, that change is
not automatically reflected in the memory of other processors.

ou Answered True

orrect answer False

Question 40 1 / 1 pts

Each core of modern processors' has their own cache that stores frequently
accessed data.

Correct! True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999882 17/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 41 1 / 1 pts

void call() method must be included when defining a class that


implements the Runnable interface?

True

Correct! False

Question 42 1 / 1 pts

If a daemon thread in Java creates another thread, that child thread will
only be a daemon thread if its parent calls the setDaemon() method
before starting it

True

Correct! False

Question 43 1 / 1 pts

A thread that calls the join method on another thread will enter the
blocked state until the other thread finishes executing.

Correct! True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999882 18/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 44 1 / 1 pts

In most operating systems, the user determines when each of the threads
and processes gets scheduled to execute.

True

Correct! False

Question 45 0 / 1 pts

System logging application that frequently writes to a database would


benefit much from parallel execution.

ou Answered True

orrect answer False

Question 46 1 / 1 pts

Every thread is independent and has its own separate address space in
memory.

True

Correct! False

Question 47 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 19/21
6/1/23, 10:15 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

If you run multiple Java applications at the same time, they will execute in
equivalent.

True

Correct! False

Question 48 1 / 1 pts

A process can be terminated due to normal exit and fatal error.

Correct! True

False

Question 49 0 / 1 pts

What is the number of binary recursion given an input arr = { 2, 5, 7, 99,


899 } and key = 899?

ou Answered the same JVM thread

the same JVM process

separate JVM threads

orrect answer separate JVM processes

https://feucanvas.instructure.com/courses/83484/quizzes/999882 20/21
6/1/23, 10:16 PM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 50 1 / 1 pts

A process can be both single threaded and multithreaded.

Correct! True

False

Quiz score: 46 out of 50

https://feucanvas.instructure.com/courses/83484/quizzes/999882 21/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

[S1 - SUMMATIVE ASSESSMENT] Module 1 and


Module 2
Due 2 Jun at 23:59 Points 50 Questions 50
Available 29 May at 0:00 - 2 Jun at 23:59 Time limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help in
this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in my
environment.

General Direction: Answer the following questions by selecting the letter that corresponds to the correct
answer.

Export Questions 

Attempt history
Attempt Time Score

LATEST Attempt 1  27 minutes 43 out of 50

Score for this quiz: 43 out of 50


Submitted 1 Jun at 2:34
This attempt took 27 minutes.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 1/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 1 0 / 1 pts

Which hardware component is responsible for dividing a program into


smaller tasks that can be executed concurrently?

orrect answer GPU

Cache

ou Answered CPU

Memory

Question 2 1 / 1 pts

What does it mean when a processor has multiple cores?

It can execute multiple instructions per clock cycle.

Correct! It can execute multiple threads simultaneously.

It can execute multiple processes simultaneously.

It can execute multiple programs simultaneously.

Question 3 1 / 1 pts

Which type of memory is often used in parallel computing to store


intermediate results?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 2/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Registers

RAM

Hard disk

Correct! Cache

Question 4 1 / 1 pts

What does it mean when a parallel algorithm exhibits load balancing?

Each processor performs the same amount of work.

The algorithm has a low communication overhead.

Correct! The workload is evenly distributed across multiple processors.

The algorithm can be executed on different types of processors.

Question 5 1 / 1 pts

What is the purpose of thread scheduling in an operating system?

To prevent thread starvation.

Correct! To allocate processor time to different threads.

To manage thread creation and termination.

To assign threads to different processors.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 3/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 6 0 / 1 pts

Which metric measures the efficiency of parallel processing by comparing


the time taken for a given workload on a single processor versus multiple
processors?

ou Answered Speedup

Scalability

orrect answer Efficiency

Amdahl's Law

Question 7 1 / 1 pts

What is the purpose of pipelining in parallel computing?

To increase the clock speed of the processor.

To improve cache performance.

To reduce the number of execution units required.

Correct! To overlap the execution of multiple instructions.

Question 8 0 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 4/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

In a multithreading environment, what is the main advantage of using


threads over processes?

Better resource isolation

Increased security

orrect answer Lower memory consumption

ou Answered Faster context switching

Question 9 1 / 1 pts

Which metric measures the speedup achieved by executing a program on


multiple processors compared to a single processor?

Efficiency

Scalability

Correct! Speedup

Amdahl's Law

Question 10 1 / 1 pts

Which of the following is an example of a concurrent programming


paradigm?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 5/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! Event-driven programming

Functional programming

Procedural programming

Object-oriented programming

Question 11 1 / 1 pts

How is data typically exchanged between different processors in a parallel


computing system?

Correct! Through message passing

Through direct memory access

Through cache coherence protocols

Through shared memory

Question 12 0 / 1 pts

Which synchronization primitive allows threads to wait until a certain


condition is satisfied before proceeding?

orrect answer Lock

ou Answered Condition variable

https://feucanvas.instructure.com/courses/83484/quizzes/999882 6/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Barrier

Semaphore

Question 13 0 / 1 pts

What is the purpose of a semaphore in concurrent programming?

To allow inter-process communication.

To ensure mutual exclusion.

ou Answered To synchronize the execution of threads.

orrect answer o allocate resources to different threads.

Question 14 1 / 1 pts

In the context of concurrent programming, what is the purpose of


deadlock detection?

Correct! To detect potential deadlock situations and take corrective action.

To resolve deadlock situations automatically.

To schedule threads for execution on different processors.

To prevent race conditions.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 7/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 15 1 / 1 pts

What is the purpose of a mutex in concurrent programming?

To prevent deadlocks in multithreaded programs.

To allow multiple threads to access a shared resource simultaneously.

To schedule threads for execution on different processors.

Correct!
To ensure that only one thread can execute a particular section of code at
a time.

Question 16 0 / 1 pts

What is a critical section in the context of concurrent programming?

A section of code that is protected by a mutex.

ou Answered A section of code where only one thread can execute at a time.

A section of code that must be executed atomically.

orrect answer A section of code where threads can execute in any order.

Question 17 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 8/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Which of the following is a characteristic of parallel computing hardware?

Correct! Increased number of execution units

Reduced power consumption

Higher clock speed

Larger cache size

Question 18 1 / 1 pts

What is the purpose of SIMD (Single Instruction, Multiple Data)


instructions in parallel computing?

To enable multiple threads to execute in parallel.

To synchronize the execution of multiple threads.

To allow multiple processes to share the same memory space.

Correct!

To perform the same operation on multiple data elements simultaneously.

Question 19 1 / 1 pts

What is the role of a memory controller in parallel computing systems?

Correct! To coordinate the access to shared memory resources.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 9/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

To synchronize the execution of threads

To allocate processor time to different threads.

To manage the flow of data between different processors.

Question 20 1 / 1 pts

Which of the following statements is true regarding thread


synchronization?

Correct! Synchronization can improve the performance of concurrent programs.

Synchronization guarantees deadlock-free execution.

Synchronization is necessary only when shared resources are involved.

Synchronization can be achieved without the use of locks or semaphores

Question 21 1 / 1 pts

Which of the following synchronization mechanisms provides the highest


level of concurrency among threads?

Mutex

Barrier

Semaphore

https://feucanvas.instructure.com/courses/83484/quizzes/999882 10/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Correct! Read-write lock

Question 22 1 / 1 pts

Which parallel computing architecture is specifically designed for


accelerating deep learning tasks?

Correct! GPGPU

FPGA

Quantum computer

ASIC

Question 23 1 / 1 pts

What is the purpose of a memory hierarchy in parallel computing


systems?

Correct! To improve cache performance.

To reduce power consumption.

To increase the clock speed of the processor.

To enable multi-threading.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 11/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 24 0 / 1 pts

Which of the following is a characteristic of a deadlock situation?

A thread accesses a shared resource without proper synchronization.

orrect answer A thread waits indefinitely for a resource.

ou Answered Two or more threads continuously compete for a resource.

A thread incorrectly modifies shared data.

Question 25 1 / 1 pts

Which of the following statements is true regarding thread-local storage


(TLS)?

It allows inter-process communication.

Correct! It provides a separate memory region for each thread.

It eliminates the need for mutual exclusion mechanisms.

It allows multiple threads to access the same shared memory region.

Question 26 1 / 1 pts

What is the fundamental unit of execution in a multiprocessing system?

https://feucanvas.instructure.com/courses/83484/quizzes/999882 12/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Task

Thread

Correct! Process

Core

Question 27 1 / 1 pts

Which synchronization primitive allows multiple threads to access a


shared resource simultaneously, as long as no thread is modifying i

Mutex

Barrier

Condition variable

Correct! Read-write lock

Question 28 1 / 1 pts

Which of the following is an example of a parallel computing architecture


that uses a shared memory model?

CUDA

Message passing interface (MPI)

Correct! OpenMP

https://feucanvas.instructure.com/courses/83484/quizzes/999882 13/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

MapReduce

Question 29 1 / 1 pts

Which type of parallel computing hardware is characterized by a large


number of relatively simple processing units?

MISD

MIMD

SISD

Correct! SIMD

Question 30 1 / 1 pts

Which of the following is an example of a mutual exclusion mechanism?

Correct! Lock

Semaphore

Monitor

Barrier

Question 31 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 14/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

A Symmetric Multi-Processing (SMP) system has two or more dissimilar


processors connected to a single shared main memory.

True

Correct! False

Question 32 1 / 1 pts

The tightly coupled set of threads' execution working on a single task is


called Distributed Processing.

True

Correct! False

Question 33 1 / 1 pts

In most modern multi-core CPUs, cache coherency is usually handled by


the application software.

True

Correct! False

Question 34 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 15/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

A key advantage of distributed memory architectures is that they are


more scalable than shared memory systems.

Correct! True

False

Question 35 1 / 1 pts

Multiple-applications dependently running, are typically called


Multithreading.

True

Correct! False

Question 36 1 / 1 pts

Shared memory scales better than Distributed memory.

True

Correct! False

Question 37 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 16/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

An SMP system has two or more identical processors which are connected to a
single shared memory often through a system bus.

Correct! True

False

Question 38 1 / 1 pts

Parallel computing can increase the speed at which a program executes a


set number of tasks.

Correct! True

False

Question 39 1 / 1 pts

Modern multi-core PCs fall into the SISD classification of Flynn's


Taxonomy.

True

Correct! False

https://feucanvas.instructure.com/courses/83484/quizzes/999882 17/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

Question 40 1 / 1 pts

UMA stands for Uniform Memory Access.

Correct! True

False

Question 41 1 / 1 pts

You can safely expect threads to execute in the same relative order that
you create them.

True

Correct! False

Question 42 1 / 1 pts

In most operating systems, the user determines when each of the threads
and processes gets scheduled to execute.

True

Correct! False

Question 43 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 18/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

When defining a new Java class, the class can implement multiple other
interfaces, which is not an advantage of implementing Java's Runnable
interface rather than inheriting from the Thread class and overriding the
run() method.

True

Correct! False

Question 44 1 / 1 pts

A thread that calls the join method on another thread will enter the
blocked state until the other thread finishes executing.

Correct! True

False

Question 45 1 / 1 pts

It is possible for two tasks to execute in parallel using a single-core


processor.

True

Correct! False

Question 46 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999882 19/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

A process contains one or more other processes.

True

Correct! False

Question 47 1 / 1 pts

Processes are faster to switch between than threads.

True

Correct! False

Question 48 1 / 1 pts

If Thread A calls the lock() method on a Lock that is already possessed by


Thread B, Thread A will immediately take possession of the Lock from
Thread B.

True

Correct! False

Question 49 1 / 1 pts

You should avoid using Java's synchronized statement on an immutable


object such as an Integer because Java will throw a compilation error.

https://feucanvas.instructure.com/courses/83484/quizzes/999882 20/21
6/1/23, 2:35 AM [S1 - SUMMATIVE ASSESSMENT] Module 1 and Module 2: 3TSY2223_CS0051_AN22-6

True

Correct! False

Question 50 1 / 1 pts

Every thread is independent and has its own separate address space in
memory.

True

Correct! False

Quiz score: 43 out of 50

https://feucanvas.instructure.com/courses/83484/quizzes/999882 21/21
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

[S2 - SUMMATIVE ASSESSMENT] Module 3 and


Module 4
Due Jun 2 at 11:59pm Points 50 Questions 50
Available May 29 at 12am - Jun 2 at 11:59pm Time Limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help
in this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in
my environment.

Export Questions 

Attempt History
Attempt Time Score

LATEST Attempt 1  33 minutes 42 out of 50

 Correct answers are hidden.

Score for this quiz: 42 out of 50


Submitted Jun 2 at 10:03pm
This attempt took 33 minutes.

Question 1 1 / 1 pts

1 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

Which type of lock is suitable for scenarios where multiple threads can
concurrently read a shared resource, but only one thread can write to
it?

Mutex lock

Reader-writer lock

Semaphore

Spin lock

Question 2 1 / 1 pts

Which of the following is an example of a concurrent data structure


used for synchronization?

Hashtable

Stack

Set

Queue

Question 3 1 / 1 pts

What is the purpose of a lock in concurrent programming?

2 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

To synchronize threads

To allow inter-process communications

To enable mutual exclusions

To prevent race conditions.

Question 4 1 / 1 pts

What is the main characteristic of an asynchronous task?

It is executed sequentially.

It is executed preemptively.

It is executed with higher priority.

It is executed in parallel with other tasks.

Question 5 1 / 1 pts

What is the difference between a deadlock and a livelock?

A deadlock involves a circular waiting dependency, while a livelock


involves busy waiting.

3 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

A deadlock affects multiple threads, while a livelock affects only a single


thread.

A deadlock can be resolved automatically, while a livelock requires


manual intervention.

A deadlock results in a system freeze, while a livelock leads to


excessive CPU usage.

Incorrect
Question 6 0 / 1 pts

Which mechanism is commonly used to handle the results of


asynchronous tasks?

Callback functions

Exception handling

Semaphore signaling

Barrier synchronization

Question 7 1 / 1 pts

What is the purpose of synchronization in concurrent programming?

To schedule threads for execution

4 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

To prevent race conditions

To ensure mutual exclusion

To allocate resources to different threads

Question 8 1 / 1 pts

Which technique is commonly used to synchronize access to shared


resources in multithreaded programs?

Message passing

Atomic operations

Barrier synchronization

Locking

Question 9 1 / 1 pts

What is the main disadvantage of using locks for synchronization in


concurrent programming?

Increased memory consumption

Inability to handle multiple threads

Reduced performance due to contention

5 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

Increased risk of deadlocks

Incorrect
Question 10 0 / 1 pts

Which of the following scenarios can lead to a deadlock situation?

Starvation of a thread

Insufficient memory allocation

Circular waiting dependency

Question 11 1 / 1 pts

What is the purpose of asynchronous programming?

To ensure that programs always terminate.

To improve performance by executing tasks in parallel.

To simplify the code by avoiding the use of locks.

To eliminate race conditions in concurrent programs.

6 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

Question 12 1 / 1 pts

What is the main advantage of asynchronous programming?

Higher execution speed

Easier debugging

Lower memory consumption

Improved responsiveness

Incorrect
Question 13 0 / 1 pts

Which technique is commonly used to avoid deadlock in concurrent


programs?

Priority inversion

Preemption

Lock-free synchronization

Resource allocation graph

Question 14 1 / 1 pts

What is a spin lock in concurrent programming?

7 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

A lock that automatically releases itself after a certain period of time.

A lock that provides priority-based synchronization between threads.

A lock that causes a thread to wait by repeatedly checking a condition in


a loop.

A lock that allows multiple threads to access a shared resource


simultaneously.

Question 15 1 / 1 pts

Which of the following is an example of a lock-based synchronization


primitive?

Read-write lock

Condition variable

Semaphore

Barrier

Question 16 1 / 1 pts

Which of the following is an example of an asynchronous programming


model?

8 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

OpenMP

MPI

Promises/Futures

Question 17 1 / 1 pts

What is the purpose of liveness in concurrent programming?

To ensure that deadlock situations are avoided.

To prevent race conditions.

To guarantee that programs always terminate.

To synchronize the execution of threads.

Question 18 1 / 1 pts

Which of the following statements is true regarding lock-free


synchronization?

It is immune to livelock situations.

It requires hardware support for atomic operations.

9 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

It eliminates the need for mutual exclusion mechanisms.

It always provides better performance than lock-based synchronization.

Question 19 1 / 1 pts

What is the purpose of a barrier synchronization primitive?

To synchronize the execution of multiple threads at a particular point.

To enforce mutual exclusion on a shared resource.

To prevent race conditions in concurrent programs.

To allow multiple threads to wait until a certain condition is satisfied.

Question 20 1 / 1 pts

Which of the following is an example of a synchronization primitive that


allows multiple threads to wait until a certain condition is satisfied?

Barrier

Semaphore

Mutex

10 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

Condition variable

Question 21 1 / 1 pts

Data race occurs when a thread is unable to gain access to a necessary


resource, and is therefore unable to make progress.

True

False

Question 22 1 / 1 pts

A thread must unlock a ReentrantLock as many times as that thread


locked it before another thread can acquire it.

True

False

Question 23 1 / 1 pts

The tryLock() method is useful because it enforces fairness among


multiple threads competing for ownership of the same lock.

True

11 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

False

Incorrect
Question 24 0 / 1 pts

Unlike during a deadlock, the threads in a livelock scenario are still


making progress towards their goal.

True

False

Question 25 1 / 1 pts

Starva�on occurs when a thread is unable to gain access to a necessary


resource, and is therefore unable to make progress.

True

False

Question 26 1 / 1 pts

The tryLock() method is useful because it includes built-in protection


against common locking errors.

True

12 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

False

Question 27 1 / 1 pts

A ReentrantLock can be locked multiple times by different threads.

True

False

Question 28 1 / 1 pts

Having too many concurrent threads can lead to starva�on.

True

False

Question 29 1 / 1 pts

A ReentrantLock can be locked once by multiple threads at the same


time.

True

False

13 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

Incorrect
Question 30 0 / 1 pts

The lock() method can be called recursively on a ReentrantLock object,


but not on a regular Lock object.

True

False

Question 31 1 / 1 pts

Which of these is a common use case for a counting semaphore?

Track the availability of a limited resource.

Track how many threads the program has created.

Enforce mutual exclusion in a critical section of code.

Track how long a program has been running.

Incorrect
Question 32 0 / 1 pts

14 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

If the producer puts elements into a fixed-length queue faster than the
consumer removes them, the queue will fill up and cause an error.

True

False

Question 33 1 / 1 pts

What is the difference between a binary semaphore and a mutex?

The binary semaphore can be acquired and released by different


threads.

The binary semaphore will have a value of 0, 1, 2, 3, etc.

The binary semaphore can only be acquired and released by the same
thread.

The binary semaphore can have a positive or negative value.

Question 34 1 / 1 pts

Condi�on variables enable threads to signal each other when the state of the
queue changes.

True

15 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

False

Question 35 1 / 1 pts

Calling the semaphore's release() method blocks and waits until the
semaphore is available.

True

False

Question 36 1 / 1 pts

If the producer puts elements into a fixed-length queue faster than the
consumer removes them, the producer will run out of elements to put in
the queue.

True

False

Question 37 1 / 1 pts

Calling the semaphore's release() method signals another thread


waiting to acquire the semaphore.

True

16 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

False

Question 38 1 / 1 pts

Tracking how long a program has been running is a common use case
for a counting semaphore.

True

False

Question 39 1 / 1 pts

The consumption rate should be greater than or equal to the production


rate in a producer-consumer architecture.

True

False

Question 40 1 / 1 pts

What happens if the producer puts elements into a fixed-length queue


faster than the consumer removes them?

The producer will run out of elements to put in the queue.

17 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

The queue will fill up and cause an error.

The queue will continuously expand to hold the extra items.

The consumer will automatically speed up to match the producer's


speed.

Question 41 1 / 1 pts

A race condi�on is a flaw in the �ming or ordering of a program's execu�on


that causes incorrect behavior.

True

False

Question 42 1 / 1 pts

Condition variables work together with a thread serving as a monitor.

True

False

Question 43 1 / 1 pts

It's not possible to have data races without a race condi�on but possible to

18 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

have race condi�ons without a data race.

True

False

Question 44 1 / 1 pts

What is the difference between Java's Callable and Runnable


interfaces?

The Callable interface's call() method returns a result object but the
Runnable interface's run() method does not.

Only Callable objects can be submitted to an ExecutorService.

A Runnable object cannot be used to create a Future.

The Runnable interface's run() method can have an optional return


value, but the Callable interface's call() method is required to always
return an object.

Incorrect
Question 45 0 / 1 pts

19 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

When implementing a recursive divide-and-conquer algorithm in Java,


the ForkJoinPool automatically subdivides the problem for you.

True

False

Question 46 1 / 1 pts

Semaphore is a synchronization tool?

True

False

Question 47 1 / 1 pts

When using a thread pool in Java, the host operating system assigns
submitted tasks to specific threads within the available pool to execute.

True

False

Incorrect
Question 48 0 / 1 pts

20 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

A future is a task that can be assigned to a thread pool for execution.

True

False

Question 49 1 / 1 pts

A deadlock avoidance algorithm dynamically examines the operating


system to ensure that a circular wait condition can never exist.

True

False

Question 50 1 / 1 pts

What does a divide-and-conquer algorithm do when it reaches the base


case?

Recursively solve a set of smaller subproblems.

Divide the problem into two smaller subproblems.

Solve all of the subproblems that have been created.

Stop subdividing the current problem and solve it.

21 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2... https://feucanvas.instructure.com/courses/83484/quizzes/999883

Quiz Score: 42 out of 50

22 of 22 6/2/2023, 22:04
[S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4
Due Jun 2 at 11:59pm Points 50 Questions 50
Available May 29 at 12am - Jun 2 at 11:59pm Time Limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise integrity and


honesty as I take this examination. I consider it dishonest to ask for, give, or receive help in this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in my
environment.

Export Questions 

Attempt History
Attempt Time Score

LATEST Attempt 1  47 minutes 47 out of 50

 Correct answers are hidden.

Score for this quiz: 47 out of 50


Submitted Jun 2 at 6:16pm
This attempt took 47 minutes.

Question 1 1 / 1 pts

What is the purpose of a barrier synchronization primitive?

To enforce mutual exclusion on a shared resource.

To synchronize the execution of multiple threads at a particular point.

To allow multiple threads to wait until a certain condition is satisfied.

To prevent race conditions in concurrent programs.

Question 2 1 / 1 pts

Which type of lock is suitable for scenarios where multiple threads can
concurrently read a shared resource, but only one thread can write to it?

Reader-writer lock

Semaphore

Spin lock

Mutex lock

Question 3 1 / 1 pts

What is the purpose of synchronization in concurrent programming?

To ensure mutual exclusion

To allocate resources to different threads

To prevent race conditions

To schedule threads for execution

Question 4 1 / 1 pts

Which of the following is an example of a synchronization primitive that allows


multiple threads to wait until a certain condition is satisfied?

Condition variable

Barrier

Semaphore

Mutex

Question 5 1 / 1 pts

What is the main characteristic of an asynchronous task?


It is executed sequentially.

It is executed in parallel with other tasks.

It is executed preemptively.

It is executed with higher priority.

Question 6 1 / 1 pts

Which of the following is an example of a lock-based synchronization primitive?

Read-write lock

Barrier

Semaphore

Condition variable

Incorrect
Question 7 0 / 1 pts

What is the purpose of a lock in concurrent programming?

To synchronize threads

To enable mutual exclusions

To allow inter-process communications

To prevent race conditions.

Question 8 1 / 1 pts

What is the main disadvantage of using locks for synchronization in concurrent


programming?

Increased memory consumption

Increased risk of deadlocks


Inability to handle multiple threads

Reduced performance due to contention

Question 9 1 / 1 pts

Which mechanism is commonly used to handle the results of asynchronous tasks?

Barrier synchronization

Semaphore signaling

Exception handling

Callback functions

Question 10 1 / 1 pts

Which technique is commonly used to avoid deadlock in concurrent programs?

Preemption

Priority inversion

Resource allocation graph

Lock-free synchronization

Question 11 1 / 1 pts

Which technique is commonly used to synchronize access to shared resources in


multithreaded programs?

Barrier synchronization

Message passing

Atomic operations

Locking
Question 12 1 / 1 pts

What is a spin lock in concurrent programming?

A lock that provides priority-based synchronization between threads.

A lock that automatically releases itself after a certain period of time.

A lock that allows multiple threads to access a shared resource simultaneously.

A lock that causes a thread to wait by repeatedly checking a condition in a loop.

Question 13 1 / 1 pts

Which of the following is an example of an asynchronous programming model?

MPI

Promises/Futures

OpenMP

Question 14 1 / 1 pts

What is the main advantage of asynchronous programming?

Easier debugging

Higher execution speed

Improved responsiveness

Lower memory consumption

Question 15 1 / 1 pts
Which of the following scenarios can lead to a deadlock situation?

Circular waiting dependency

Starvation of a thread

Insufficient memory allocation

Question 16 1 / 1 pts

Which of the following is an example of a concurrent data structure used for


synchronization?

Set

Hashtable

Stack

Queue

Question 17 1 / 1 pts

What is the purpose of liveness in concurrent programming?

To ensure that deadlock situations are avoided.

To guarantee that programs always terminate.

To synchronize the execution of threads.

To prevent race conditions.

Question 18 1 / 1 pts

Which of the following statements is true regarding lock-free synchronization?


It requires hardware support for atomic operations.

It eliminates the need for mutual exclusion mechanisms.

It always provides better performance than lock-based synchronization.

It is immune to livelock situations.

Question 19 1 / 1 pts

What is the difference between a deadlock and a livelock?

A deadlock can be resolved automatically, while a livelock requires manual


intervention.

A deadlock involves a circular waiting dependency, while a livelock involves busy


waiting.

A deadlock results in a system freeze, while a livelock leads to excessive CPU


usage.

A deadlock affects multiple threads, while a livelock affects only a single thread.

Question 20 1 / 1 pts

What is the purpose of asynchronous programming?

To ensure that programs always terminate.

To eliminate race conditions in concurrent programs.

To improve performance by executing tasks in parallel.

To simplify the code by avoiding the use of locks.

Question 21 1 / 1 pts

A possible strategy to resolve a livelock between multiple threads is thru randomly


terminating one of the threads involved in the livelock.
True

False

Question 22 1 / 1 pts

The tryLock() method is useful because if multiple threads try to acquire a lock
simultaneously, the tryLock() method will randomly pick one to succeed.

True

False

Question 23 1 / 1 pts

ReentrantLock is a class that implements the Lock interface.

True

False

Question 24 1 / 1 pts

A possible strategy to resolve a livelock between multiple threads is thru patience


because if you wait long enough all livelocks will eventually resolve themself.

True

False

Question 25 1 / 1 pts
When the threads in the program are not making progress, you can determine if it
is due to a deadlock or a livelock by randomly guessing between deadlock and
livelock.

True

False

Question 26 1 / 1 pts

Data race occurs when a thread is unable to gain access to a necessary resource, and is
therefore unable to make progress.

True

False

Question 27 1 / 1 pts

A ReentrantLock instantiates a new internal Lock object every time its lock()
method is called.

True

False

Question 28 1 / 1 pts

The processor decides when each thread gets scheduled to execute.

True

False

Question 29 1 / 1 pts

A thread must unlock a ReentrantLock as many times as that thread locked it


before another thread can acquire it.
True

False

Question 30 1 / 1 pts

Dining Philosophers Problem is a classic example that's used to illustrate synchroniza�on


issues when mul�ple threads are compe�ng for mul�ple locks.

True

False

Question 31 1 / 1 pts

If the producer puts elements into a fixed-length queue faster than the consumer
removes them, the queue will fill up and cause an error.

True

False

Question 32 1 / 1 pts

If the producer puts elements into a fixed-length queue faster than the consumer
removes them, the producer will run out of elements to put in the queue.

True

False

Incorrect
Question 33 0 / 1 pts
Calling the semaphore's release() method blocks all other threads waiting on the
semaphore.

True

False

Question 34 1 / 1 pts

Distributed architecture consists of a chained-together series of producer-


consumer pairs.

True

False

Question 35 1 / 1 pts

The producer-consumer pa�ern follows FIFO method.

True

False

Question 36 1 / 1 pts

What happens if the producer puts elements into a fixed-length queue faster than
the consumer removes them?

The producer will run out of elements to put in the queue.

The queue will fill up and cause an error.

The consumer will automatically speed up to match the producer's speed.

The queue will continuously expand to hold the extra items.

Question 37 1 / 1 pts
Tracking how long a program has been running is a common use case for a
counting semaphore.

True

False

Question 38 1 / 1 pts

A Semaphore is different from a Mutex in such a way that both can be released by
different threads.

True

False

Question 39 1 / 1 pts

The producer-consumer pa�ern follows LIFO method.

True

False

Question 40 1 / 1 pts

The semaphore's acquire() method always increments the counter's value.

True

False

Question 41 1 / 1 pts

What is the purpose of a future?

It serves as a placeholder to access a result that may not been computed yet.

It is a task that can be assigned to a thread pool for execution.


It serves as the counterpart to a programming past.

It allows a program to change how it will function the next time it is run.

Question 42 1 / 1 pts

When it reaches the base case, a divide-and-conquer algorithm solves all of the
subproblems that have been created.

True

False

Question 43 1 / 1 pts

When implementing a recursive divide-and-conquer algorithm in Java, the


ForkJoinPool automatically subdivides the problem for you.

True

False

Question 44 1 / 1 pts

Thread is a synchronization tool?

True

False

Question 45 1 / 1 pts
When using a thread pool in Java, the compiler assigns submitted tasks to specific
threads within the available pool to execute.

True

False

Question 46 1 / 1 pts

A future serves as the counterpart to a programming past.

True

False

Question 47 1 / 1 pts

When using a thread pool in Java, the _____ assigns submitted tasks to specific
threads within the available pool to execute.

programmer

host operating system

compiler

thread pool executor service

Question 48 1 / 1 pts

A race condi�on is a flaw in the �ming or ordering of a program's execu�on that causes
incorrect behavior.

True

False

Incorrect
Question 49 0 / 1 pts
A future is a task that can be assigned to a thread pool for execution.

True

False

Question 50 1 / 1 pts

When it reaches the base case, a divide-and-conquer algorithm divides the


problem into two smaller subproblems.

True

False

Quiz Score: 47 out of 50


6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

[S2 - SUMMATIVE ASSESSMENT] Module 3 and


Module 4
Due 2 Jun at 23:59 Points 50 Questions 50
Available 29 May at 0:00 - 2 Jun at 23:59 Time limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help in
this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in my
environment.

Export Questions 

Attempt history
Attempt Time Score

LATEST Attempt 1  29 minutes 34 out of 50

 Correct answers are hidden.

Score for this quiz: 34 out of 50


Submitted 2 Jun at 13:33
This attempt took 29 minutes.

Question 1 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 1/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

What is the main advantage of asynchronous programming?

Easier debugging

Lower memory consumption

Higher execution speed

Improved responsiveness

Question 2 1 / 1 pts

What is the difference between a deadlock and a livelock?

A deadlock results in a system freeze, while a livelock leads to excessive


CPU usage.

A deadlock affects multiple threads, while a livelock affects only a single


thread.

A deadlock can be resolved automatically, while a livelock requires manual


intervention.

A deadlock involves a circular waiting dependency, while a livelock


involves busy waiting.

https://feucanvas.instructure.com/courses/83484/quizzes/999883 2/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 3 1 / 1 pts

Which of the following is an example of a lock-based synchronization


primitive?

Condition variable

Read-write lock

Barrier

Semaphore

Incorrect Question 4 0 / 1 pts

Which technique is commonly used to avoid deadlock in concurrent


programs?

Priority inversion

Resource allocation graph

Lock-free synchronization

Preemption

Question 5 1 / 1 pts

Which of the following is an example of a concurrent data structure


used for synchronization?
https://feucanvas.instructure.com/courses/83484/quizzes/999883 3/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Queue

Hashtable

Set

Stack

Incorrect Question 6 0 / 1 pts

What is the purpose of a barrier synchronization primitive?

To synchronize the execution of multiple threads at a particular point.

To allow multiple threads to wait until a certain condition is satisfied.

To enforce mutual exclusion on a shared resource.

To prevent race conditions in concurrent programs.

Question 7 1 / 1 pts

What is a spin lock in concurrent programming?

A lock that causes a thread to wait by repeatedly checking a condition in a


loop.

https://feucanvas.instructure.com/courses/83484/quizzes/999883 4/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

A lock that allows multiple threads to access a shared resource


simultaneously.

A lock that automatically releases itself after a certain period of time.

A lock that provides priority-based synchronization between threads.

Incorrect Question 8 0 / 1 pts

What is the purpose of a lock in concurrent programming?

To allow inter-process communications

To synchronize threads

To prevent race conditions.

To enable mutual exclusions

Question 9 1 / 1 pts

Which of the following is an example of an asynchronous programming


model?

Promises/Futures

OpenMP

https://feucanvas.instructure.com/courses/83484/quizzes/999883 5/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

MPI

Question 10 1 / 1 pts

Which of the following statements is true regarding lock-free


synchronization?

It always provides better performance than lock-based synchronization.

It requires hardware support for atomic operations.

It eliminates the need for mutual exclusion mechanisms.

It is immune to livelock situations.

Question 11 1 / 1 pts

Which type of lock is suitable for scenarios where multiple threads can
concurrently read a shared resource, but only one thread can write to it?

Reader-writer lock

Semaphore

Mutex lock

Spin lock

https://feucanvas.instructure.com/courses/83484/quizzes/999883 6/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 12 1 / 1 pts

Which technique is commonly used to synchronize access to shared


resources in multithreaded programs?

Locking

Message passing

Atomic operations

Barrier synchronization

Question 13 1 / 1 pts

What is the main disadvantage of using locks for synchronization in


concurrent programming?

Inability to handle multiple threads

Reduced performance due to contention

Increased risk of deadlocks

Increased memory consumption

Question 14 1 / 1 pts

What is the main characteristic of an asynchronous task?

https://feucanvas.instructure.com/courses/83484/quizzes/999883 7/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

It is executed preemptively.

It is executed in parallel with other tasks.

It is executed with higher priority.

It is executed sequentially.

Incorrect Question 15 0 / 1 pts

Which of the following is an example of a synchronization primitive that


allows multiple threads to wait until a certain condition is satisfied?

Condition variable

Mutex

Barrier

Semaphore

Question 16 1 / 1 pts

What is the purpose of liveness in concurrent programming?

To prevent race conditions.

To ensure that deadlock situations are avoided.

To guarantee that programs always terminate.

https://feucanvas.instructure.com/courses/83484/quizzes/999883 8/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

To synchronize the execution of threads.

Question 17 1 / 1 pts

What is the purpose of asynchronous programming?

To eliminate race conditions in concurrent programs.

To simplify the code by avoiding the use of locks.

To improve performance by executing tasks in parallel.

To ensure that programs always terminate.

Question 18 1 / 1 pts

Which of the following scenarios can lead to a deadlock situation?

Insufficient memory allocation

Starvation of a thread

Circular waiting dependency

Question 19 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 9/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Which mechanism is commonly used to handle the results of


asynchronous tasks?

Barrier synchronization

Exception handling

Semaphore signaling

Callback functions

Question 20 1 / 1 pts

What is the purpose of synchronization in concurrent programming?

To allocate resources to different threads

To prevent race conditions

To schedule threads for execution

To ensure mutual exclusion

Question 21 1 / 1 pts

The tryLock() method is useful because if multiple threads try to acquire a


lock simultaneously, the tryLock() method will randomly pick one to
succeed.

True

https://feucanvas.instructure.com/courses/83484/quizzes/999883 10/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

False

Incorrect Question 22 0 / 1 pts

The lock() method can be called recursively on a ReentrantLock object,


but not on a regular Lock object.

True

False

Incorrect Question 23 0 / 1 pts

The processor decides when each thread gets scheduled to execute.

True

False

Question 24 1 / 1 pts

A thread does not need to unlock a ReentrantLock before another thread


can acquire it because multiple threads can lock a ReentrantLock at the
same time.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 11/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 25 1 / 1 pts

The threads in your program are clearly not making progress. How might
you determine if it is due to a deadlock or a livelock?

Wait to see if the problem eventually resolves itself.

Use the Resource Monitor to investigate the program's CPU usage to see
if it is actively executing.

Use the Resource Monitor to investigate the program's memory usage to


see if it continues to grow.

Randomly guess between deadlock and livelock. You have a 50/50 shot at
being right!

Incorrect Question 26 0 / 1 pts

To avoid livelock, ensure that only one process takes action chosen by priority or
some other mechanism, like random selection.

True

False

Question 27 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 12/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

What is the difference between the tryLock() and the regular lock()
method in Java?

tryLock() includes built-in error handling so you do not need a separate


try/catch statement

tryLock() will continuously try to acquire the lock if it is already taken by


another thread

tryLock() is a non-blocking version of the lock() method

none of the mentioned

Incorrect Question 28 0 / 1 pts

The tryLock() method is useful because it includes built-in protection


against common locking errors.

True

False

Incorrect Question 29 0 / 1 pts

A thread must unlock a ReentrantLock as many times as that thread


locked it before another thread can acquire it.

True

https://feucanvas.instructure.com/courses/83484/quizzes/999883 13/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

False

Question 30 1 / 1 pts

The tryLock() method is useful because it enables a thread to execute


alternate operations if the lock it needs to acquire is already taken.

True

False

Question 31 1 / 1 pts

If the producer puts elements into a fixed-length queue faster than the
consumer removes them, the consumer will automatically speed up to
match the producer's speed.

True

False

Question 32 1 / 1 pts

The binary semaphore can only be acquired and released by the same
thread.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 14/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Incorrect Question 33 0 / 1 pts

Enforcing mutual exclusion in a critical section of code is a common use


case for a counting semaphore.

True

False

Incorrect Question 34 0 / 1 pts

A Semaphore is different from a Mutex in such a way that both can be released
by different threads.

True

False

Incorrect Question 35 0 / 1 pts

The consumption rate should be less than or equal to the production rate
in a producer-consumer architecture.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 15/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Incorrect Question 36 0 / 1 pts

Calling the semaphore's release() method signals another thread waiting


to acquire the semaphore.

True

False

Question 37 1 / 1 pts

Distributed architecture consists of a chained-together series of producer-


consumer pairs.

True

False

Question 38 1 / 1 pts

The semaphore's release() method increments its value if the counter is


positive.

True

False

Question 39 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 16/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

The consumption rate should be greater than or equal to the production


rate in a producer-consumer architecture.

True

False

Question 40 1 / 1 pts

The binary semaphore can be acquired and released by different threads.

True

False

Incorrect Question 41 0 / 1 pts

Condition variables work together with a thread serving as a monitor.

True

False

Incorrect Question 42 0 / 1 pts

Condition variables work together with which other mechanism serving as


a monitor?

https://feucanvas.instructure.com/courses/83484/quizzes/999883 17/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

a thread

a process

a mutex

the OS execution scheduler

Question 43 1 / 1 pts

A deadlock avoidance algorithm dynamically examines the __________ to


ensure that a circular wait condition can never exist.

system storage state

resources

operating system

resource allocation state

Question 44 1 / 1 pts

Socket is a synchronization tool?

True

False

Question 45 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 18/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

A future serves as the counterpart to a programming past.

True

False

Incorrect Question 46 0 / 1 pts

A deadlock avoidance algorithm dynamically examines the resources to


ensure that a circular wait condition can never exist.

True

False

Question 47 1 / 1 pts

When using a thread pool in Java, the thread pool executor service
assigns submitted tasks to specific threads within the available pool to
execute.

True

False

Question 48 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 19/20
6/2/23, 1:36 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

A future allows a program to change how it will function the next time it is
run.

True

False

Question 49 1 / 1 pts

It's not possible to have data races without a race condition but possible to have
race conditions without a data race.

True

False

Question 50 1 / 1 pts

What does a divide-and-conquer algorithm do when it reaches the base


case?

Recursively solve a set of smaller subproblems.

Stop subdividing the current problem and solve it.

Divide the problem into two smaller subproblems.

Solve all of the subproblems that have been created.

Quiz score: 34 out of 50

https://feucanvas.instructure.com/courses/83484/quizzes/999883 20/20
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

[S2 - SUMMATIVE ASSESSMENT] Module 3 and


Module 4
Due 2 Jun at 23:59 Points 50 Questions 50
Available 29 May at 0:00 - 2 Jun at 23:59 Time limit 60 Minutes

Instructions
Summative Assessment 1
Parallel and Distributed Computing

PLEDGE OF HONOR

I, , a student of the FEU Tech/Alabang/Diliman, pledge to exercise


integrity and honesty as I take this examination. I consider it dishonest to ask for, give, or receive help in
this examination.

I pledge to do all that is in my power to live a life of dignity and credibility and to create that spirit in my
environment.

Export Questions 

Attempt history
Attempt Time Score

LATEST Attempt 1  22 minutes 50 out of 50

 Correct answers are hidden.

Score for this quiz: 50 out of 50


Submitted 2 Jun at 19:22
This attempt took 22 minutes.

Question 1 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 1/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

What is the purpose of liveness in concurrent programming?

To prevent race conditions.

To guarantee that programs always terminate.

To synchronize the execution of threads.

To ensure that deadlock situations are avoided.

Question 2 1 / 1 pts

What is the purpose of asynchronous programming?

To simplify the code by avoiding the use of locks.

To improve performance by executing tasks in parallel.

To eliminate race conditions in concurrent programs.

To ensure that programs always terminate.

Question 3 1 / 1 pts

What is the purpose of synchronization in concurrent programming?

To schedule threads for execution

To prevent race conditions

https://feucanvas.instructure.com/courses/83484/quizzes/999883 2/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

To ensure mutual exclusion

To allocate resources to different threads

Question 4 1 / 1 pts

What is the main characteristic of an asynchronous task?

It is executed sequentially.

It is executed with higher priority.

It is executed in parallel with other tasks.

It is executed preemptively.

Question 5 1 / 1 pts

Which of the following is an example of a concurrent data structure used


for synchronization?

Set

Stack

Queue

Hashtable

https://feucanvas.instructure.com/courses/83484/quizzes/999883 3/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 6 1 / 1 pts

What is the difference between a deadlock and a livelock?

A deadlock affects multiple threads, while a livelock affects only a single


thread.

A deadlock can be resolved automatically, while a livelock requires manual


intervention.

A deadlock results in a system freeze, while a livelock leads to excessive


CPU usage.

A deadlock involves a circular waiting dependency, while a livelock


involves busy waiting.

Question 7 1 / 1 pts

What is the purpose of a lock in concurrent programming?

To synchronize threads

To allow inter-process communications

To enable mutual exclusions

To prevent race conditions.

https://feucanvas.instructure.com/courses/83484/quizzes/999883 4/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 8 1 / 1 pts

What is the purpose of a barrier synchronization primitive?

To synchronize the execution of multiple threads at a particular point.

To allow multiple threads to wait until a certain condition is satisfied.

To enforce mutual exclusion on a shared resource.

To prevent race conditions in concurrent programs.

Question 9 1 / 1 pts

What is a spin lock in concurrent programming?

A lock that automatically releases itself after a certain period of time.

A lock that causes a thread to wait by repeatedly checking a condition in a


loop.

A lock that provides priority-based synchronization between threads.

A lock that allows multiple threads to access a shared resource


simultaneously.

https://feucanvas.instructure.com/courses/83484/quizzes/999883 5/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 10 1 / 1 pts

Which of the following scenarios can lead to a deadlock situation?

Starvation of a thread

Circular waiting dependency

Insufficient memory allocation

Question 11 1 / 1 pts

Which of the following is an example of a synchronization primitive that


allows multiple threads to wait until a certain condition is satisfied?

Barrier

Condition variable

Mutex

Semaphore

Question 12 1 / 1 pts

What is the main advantage of asynchronous programming?

https://feucanvas.instructure.com/courses/83484/quizzes/999883 6/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Lower memory consumption

Improved responsiveness

Higher execution speed

Easier debugging

Question 13 1 / 1 pts

Which type of lock is suitable for scenarios where multiple threads can
concurrently read a shared resource, but only one thread can write to it?

Mutex lock

Reader-writer lock

Semaphore

Spin lock

Question 14 1 / 1 pts

Which of the following is an example of an asynchronous programming


model?

MPI

OpenMP

https://feucanvas.instructure.com/courses/83484/quizzes/999883 7/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Promises/Futures

Question 15 1 / 1 pts

Which technique is commonly used to synchronize access to shared


resources in multithreaded programs?

Message passing

Barrier synchronization

Atomic operations

Locking

Question 16 1 / 1 pts

What is the main disadvantage of using locks for synchronization in


concurrent programming?

Increased memory consumption

Reduced performance due to contention

Inability to handle multiple threads

Increased risk of deadlocks

https://feucanvas.instructure.com/courses/83484/quizzes/999883 8/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 17 1 / 1 pts

Which mechanism is commonly used to handle the results of


asynchronous tasks?

Barrier synchronization

Exception handling

Callback functions

Semaphore signaling

Question 18 1 / 1 pts

Which of the following statements is true regarding lock-free


synchronization?

It always provides better performance than lock-based synchronization.

It is immune to livelock situations.

It eliminates the need for mutual exclusion mechanisms.

It requires hardware support for atomic operations.

Question 19 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 9/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Which of the following is an example of a lock-based synchronization


primitive?

Read-write lock

Barrier

Condition variable

Semaphore

Question 20 1 / 1 pts

Which technique is commonly used to avoid deadlock in concurrent


programs?

Preemption

Lock-free synchronization

Resource allocation graph

Priority inversion

Question 21 1 / 1 pts

ReentrantLock is a class that implements the Lock interface.

True

https://feucanvas.instructure.com/courses/83484/quizzes/999883 10/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

False

Question 22 1 / 1 pts

The tryLock() method is useful because it includes built-in protection


against common locking errors.

True

False

Question 23 1 / 1 pts

Dining Philosophers Problem is a classic example that's used to illustrate


synchronization issues when multiple threads are competing for multiple locks.

True

False

Question 24 1 / 1 pts

Data race occurs when a thread is unable to gain access to a necessary resource,
and is therefore unable to make progress.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 11/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 25 1 / 1 pts

When the threads in the program are not making progress, you can
determine if it is due to a deadlock or a livelock by using the Resource
Monitor to investigate the program's memory usage to see if it continues
to grow.

True

False

Question 26 1 / 1 pts

Unlike during a deadlock, the threads in a livelock scenario are stuck in a


blocked state waiting on other threads.

True

False

Question 27 1 / 1 pts

A ReentrantLock instantiates a new internal Lock object every time its


lock() method is called.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 12/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 28 1 / 1 pts

A ReentrantLock can be locked multiple times by different threads.

True

False

Question 29 1 / 1 pts

A thread must unlock a ReentrantLock once before another thread can


acquire it.

True

False

Question 30 1 / 1 pts

When the threads in the program are not making progress, you can
determine if it is due to a deadlock or a livelock waiting to see if the
problem eventually resolves itself.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 13/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 31 1 / 1 pts

Client-server architecture consists of a chained-together series of


producer-consumer pairs.

True

False

Question 32 1 / 1 pts

The semaphore's release() method always decrements the counter's


value.

True

False

Question 33 1 / 1 pts

The semaphore's release() method increments its value if the counter is


positive.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 14/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 34 1 / 1 pts

The producer-consumer pattern follows LIFO method.

True

False

Question 35 1 / 1 pts

Calling the semaphore's release() method blocks and waits until the
semaphore is available.

True

False

Question 36 1 / 1 pts

Which of these is a possible strategy to prevent deadlocks when multiple


threads will need to acquire multiple locks?

Create an extra thread to release the locks at random intervals to breakup


a deadlock.

Create a single "master lock" that all threads must first acquire before
locking or unlocking any of the other locks.

https://feucanvas.instructure.com/courses/83484/quizzes/999883 15/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Prioritize the locks so that all threads will acquire them in the same relative
order.

Hope that you get lucky and a deadlock doesn't occur.

Question 37 1 / 1 pts

Tracking the availability of a limited resource is a common use case for a


counting semaphore.

True

False

Question 38 1 / 1 pts

In addition to modifying the counter value, what else does calling the
semaphore's release() method do?

Block all other threads waiting on the semaphore.

Signal another thread waiting to acquire the semaphore.

nothing else

Block and wait until the semaphore is available.

Question 39 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 16/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

The average rates of production and consumption has not relation in a


producer-consumer architecture?

True

False

Question 40 1 / 1 pts

Pipeline architecture consists of a chained-together series of producer-


consumer pairs.

True

False

Question 41 1 / 1 pts

When implementing a recursive divide-and-conquer algorithm in Java, the


ForkJoinPool manages a thread pool to execute its ForkJoinTasks, which
reduces the overhead of thread creation.

True

False

Question 42 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 17/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

When implementing a recursive divide-and-conquer algorithm in Java,


using a ForkJoinPool is the only way to create an asynchronous task in
Java that returns a result.

True

False

Question 43 1 / 1 pts

When implementing a recursive divide-and-conquer algorithm in Java,


threads cannot recursively spawn other threads.

True

False

Question 44 1 / 1 pts

When it reaches the base case, a divide-and-conquer algorithm stops


subdividing the current problem and solve it.

True

False

Question 45 1 / 1 pts

https://feucanvas.instructure.com/courses/83484/quizzes/999883 18/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Why are thread pools useful?

Threads like to relax and go for a swim every once in a while.

They provide a convenient way to group and organize a collection of


related threads.

They reuse threads to reduce the overhead that would be required to


create a new, separate thread for every concurrent task.

Threads within the same thread pool can more easily share data with each
other than standard non-pool threads.

Question 46 1 / 1 pts

Only Callable objects can be submitted to an ExecutorService.

True

False

Question 47 1 / 1 pts

When implementing a recursive divide-and-conquer algorithm in Java,


why should you use a ForkJoinPool instead of simply creating new
threads to handle each subproblem?

https://feucanvas.instructure.com/courses/83484/quizzes/999883 19/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Threads cannot recursively spawn other threads.

Using a ForkJoinPool is the only way to create an asynchronous task in


Java that returns a result.

The ForkJoinPool manages a thread pool to execute its ForkJoinTasks,


which reduces the overhead of thread creation.

The ForkJoinPool automatically subdivides the problem for you.

Question 48 1 / 1 pts

Semaphore is a synchronization tool?

True

False

Question 49 1 / 1 pts

When it reaches the base case, a divide-and-conquer algorithm divides


the problem into two smaller subproblems.

True

False

https://feucanvas.instructure.com/courses/83484/quizzes/999883 20/21
6/2/23, 7:24 PM [S2 - SUMMATIVE ASSESSMENT] Module 3 and Module 4: 3TSY2223_CS0051_AN22-6

Question 50 1 / 1 pts

When it reaches the base case, a divide-and-conquer algorithm solves all


of the subproblems that have been created.

True

False

Quiz score: 50 out of 50

https://feucanvas.instructure.com/courses/83484/quizzes/999883 21/21

You might also like