SlideShare a Scribd company logo
1 of 8
Download to read offline
Submitted to
Sir. Bilal Shahzad
Submitted by
BCSF13A024
BCSF13A034
BCSF13A039
Presentation Video
https://youtu.be/kZKPIdLCWUc
Degree
BS (CS)
Punjab University College of Information Technology,
Lahore
MCQS
1) Thread pool is used to ________.
Select correct option:
A. To make easy the process of thread creation
B. To make easy debugging process
C. To save time of thread creation
D. To avoid complexity.
2) Thread pool creates or reduces real threads using a hillclimbing algo to ______.
Select correct option:
A. To maximize CUP usage
B. To reduce the cost of thread creation
C. To maximize memory utilization
D. To minimize CPU usage
3) While dealing with "threads" in ".Net", one can avoid performance bottlenecks and
enhance the overall responsiveness of his / her application by using _____________
programming.
Select correct option:
A. Multithreading programming
B. Synchronous programming
C. Parallel programming
D. Asynchronous programming
4) Which of the following is correct way to temporarily stop execution of a thread object
named as "myThread" for 500 milisec?
A. myThread.Sleep(0.05);
B. myThread.Stop(0.05);
C. myThread.Sleep(500);
D. myThread.Stop(500);
5) ______________ is more than one thing happening at the same time.
Select correct option:
A. Cohesion
B. Congruence
C. Coherence
D. Concurrency
6) Which of the following class supports data parallelism in "Task Parallel Library"?
Select correct option:
A. System.Threading.Tasks
B. System.Task.Parallel
C. System.threading.Task.Parallel
D. System.Task.Threading.Parallel
7) The "Task Based Asynchronous pattern" method returns either a "Task" or a
"Task<TResult>", based on whether the corresponding __________ method returns
"void" or a type "TResult".
A. Callback
B. Return
C. Asynchronous
D. Synchronous
8) Which of the following is not a part of "cancellation" task?
A. The calling thread does forcibly end the task
B. Notice and respond to the cancellation request in your user delegate
C. Pass a cancellation token to your user delegate and optionally to the task instance
D. Create and start a cancelable task
9) Which of the following is not handled by the “Task Parallel Library (TPL)”?
A. Partitioning of the work
B. Progress report handling
C. Scheduling of threads
D. Scales the degree of concurrency
10) Observe the following piece of code taken out from Main() function: Thread myThread =
new Thread (Go); myThread.Strat(); myThread.Join(); What will be the effect Of
instruction myThread.Join()?
A. Execution of myThread will be joined with existing running threads
B. myThread will be executed after Main thread is completed
C. Main thread execution will be suspended till completion of myThread
D. Both Main thread and myThread can now share the data
11) The Task Parallel Library introduces the concept of _________
A. Task
B. Thread
C. Files
D. Multithreading
12) Why Task Parallel Library uses tasks instead of threads
A. Threads consists of context switching
B. Thread Creation is costly
C. It uses the Thread Pool under the hood, in order to distribute the work
D. All of the above
13) Which of the following class supports "Task Parallel Library"?
Select correct option:
A. System.Threading.Tasks
B. System.Task.Parallel
C. System.threading.Task.Parallel
D. System.Task.Threading.Parallel
14) How we create a new task?
A. Task t1
B. Task t1 = new Task()
C. Task t1 = new Task(action)
D. None of the above
15) How we can wait for a task to finish?
E. Task.Join(task1)
F. Task.Wait(task1)
G. Task.Exit()
H. None of the above
16) How we can wait for all tasks to finish
A. Task.JoinAll(task1)
B. Task.WaitAll(task1,task2,task3)
C. Task.ExitAll()
D. None of the above
17) In which .NET framework Task Parallel Library was introduced
A. 1.0
B. 2.0
C. 3.0
D. 4.0
18) How to invoke more than one actions in parallel?
A. Invoke(a1,a2,a3)
B. Parallel(a1,a2,a3)
C. Task.Parallel(a1,a2,a3)
D. Parallel.Invoke(a1,a2,a3)
19) What is Parallel.For loop?
A. Parallel.For loop is used for Parallelism, which is taking a certain task and dividing
it into a set of related tasks to be executed concurrently.
B. Same as for loop, which is used for task.
C. Parallel.For loop is used for Parallelism, which is taking a certain threads and dividing it
into a set of related threads to be executed concurrently.
D. Both A and C.
20) What is the parallel implementation of LINQ to Objects?
A. LINQ
B. LINQ to tasks
C. LINQ to Parallel
D. PLINQ
21) In .NET, a task that doesn’t return a value is represented by the ____________
A. System.Threading.Tasks.Task<TResult>
B. System.Threading.Tasks.Task
C. System.Threading.Tasks
D. None of the above.
22) In .NET a Task represents an __________ operation.
A. Synchronous
B. Asynchronous
C. Parallel
D. Callback
23) How to create a continuation that executes asynchronously when the target Task completes?
A. Task(Action<Task>)
B. Task.Continue(Action<Task>)
C. Task.ContinueWith(Action<Task>)
D. Both A and C
24) How to release all resources used by a particular instance of task?
A. task.Destroy()
B. task.Exit()
C. task.Release()
D. task.Dispose()
25) How to run a created task after a particular delay
A. task.Start(10)
B. task.Create(10)
C. task.Delay(10)
D. task.Join(10)
26) The Task Parallel Library (TPL) is a set of public types and APIs in the namespace:
a. System.Threading
b. System.Data
c. System.Resources
d. System.Management
27) A difference between threads and tasks:
a. Time slicing is used for tasks whereas threads run simultaneously
b. Time slicing is used for threads whereas tasks run simultaneously
c. Threads utilize the complete power of multicores whereas tasks don’t
d. Both b and c
28) Which of the following is not a state of the task:
a. Faulted
b. Canceled
c. Completed
d. Zombie
29) How to run the Task synchronously on the current TaskScheduler.
A. task.run(synchrnous)
B. task.sync()
C. task.synchronous()
D. task.RunSynchronously()
30) How to get the unique ID of currently executing task.
A. task.id
B. task.GetID()
C. task.CurrentId
D. None of the above.
REFERENCE
https://msdn.microsoft.com/en-us/library/system.threading.tasks.task%28v=vs.100%29.aspx
https://msdn.microsoft.com/en-us/library/dd537609(v=vs.110).aspx
http://vustudents.ning.com/group/cs411-visual-programming/forum/topics/quiz-4-february-
27-2015-february-27-2015-from-32-to-42-
lectures?commentId=3783342%3AComment%3A4947917&xg_source=activity&groupId=3
783342%3AGroup%3A4194109

More Related Content

What's hot

imageprocessing-abstract
imageprocessing-abstractimageprocessing-abstract
imageprocessing-abstract
Jagadeesh Kumar
 
License Plate Recognition System
License Plate Recognition System License Plate Recognition System
License Plate Recognition System
Hira Rizvi
 
Computer Vision for Traffic Sign Recognition
Computer Vision for Traffic Sign RecognitionComputer Vision for Traffic Sign Recognition
Computer Vision for Traffic Sign Recognition
thevijayps
 

What's hot (20)

imageprocessing-abstract
imageprocessing-abstractimageprocessing-abstract
imageprocessing-abstract
 
Autonomous car
Autonomous carAutonomous car
Autonomous car
 
Mathematical operations in image processing
Mathematical operations in image processingMathematical operations in image processing
Mathematical operations in image processing
 
Unity
UnityUnity
Unity
 
License Plate Recognition System
License Plate Recognition System License Plate Recognition System
License Plate Recognition System
 
Final Project presentation on Image processing based intelligent traffic cont...
Final Project presentation on Image processing based intelligent traffic cont...Final Project presentation on Image processing based intelligent traffic cont...
Final Project presentation on Image processing based intelligent traffic cont...
 
Face Recognition Proposal Presentation
Face Recognition Proposal PresentationFace Recognition Proposal Presentation
Face Recognition Proposal Presentation
 
Computer Vision for Traffic Sign Recognition
Computer Vision for Traffic Sign RecognitionComputer Vision for Traffic Sign Recognition
Computer Vision for Traffic Sign Recognition
 
Machine Learning & Self-Driving Cars
Machine Learning & Self-Driving CarsMachine Learning & Self-Driving Cars
Machine Learning & Self-Driving Cars
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
 
Brain Tumor Detection using CNN
Brain Tumor Detection using CNNBrain Tumor Detection using CNN
Brain Tumor Detection using CNN
 
Image classification using convolutional neural network
Image classification using convolutional neural networkImage classification using convolutional neural network
Image classification using convolutional neural network
 
Color detection
Color detectionColor detection
Color detection
 
Deep Learning: Application Landscape - March 2018
Deep Learning: Application Landscape - March 2018Deep Learning: Application Landscape - March 2018
Deep Learning: Application Landscape - March 2018
 
project final ppt.pptx
project final ppt.pptxproject final ppt.pptx
project final ppt.pptx
 
Ai for logistics
Ai for logisticsAi for logistics
Ai for logistics
 
Brain Tumor Detection Using Image Processing
Brain Tumor Detection Using Image ProcessingBrain Tumor Detection Using Image Processing
Brain Tumor Detection Using Image Processing
 
Region based image segmentation
Region based image segmentationRegion based image segmentation
Region based image segmentation
 
3 d printing an emerging era of future
 3 d printing an emerging era of future 3 d printing an emerging era of future
3 d printing an emerging era of future
 
Lecture 2 Basic Concepts in Machine Learning for Language Technology
Lecture 2 Basic Concepts in Machine Learning for Language TechnologyLecture 2 Basic Concepts in Machine Learning for Language Technology
Lecture 2 Basic Concepts in Machine Learning for Language Technology
 

Viewers also liked

Viewers also liked (11)

PostgreSQL with OpenCL
PostgreSQL with OpenCLPostgreSQL with OpenCL
PostgreSQL with OpenCL
 
PG-Strom - A FDW module utilizing GPU device
PG-Strom - A FDW module utilizing GPU devicePG-Strom - A FDW module utilizing GPU device
PG-Strom - A FDW module utilizing GPU device
 
TPL Dataflow – зачем и для кого?
TPL Dataflow – зачем и для кого?TPL Dataflow – зачем и для кого?
TPL Dataflow – зачем и для кого?
 
Task Parallel Library 2014
Task Parallel Library 2014Task Parallel Library 2014
Task Parallel Library 2014
 
SQL+GPU+SSD=∞ (English)
SQL+GPU+SSD=∞ (English)SQL+GPU+SSD=∞ (English)
SQL+GPU+SSD=∞ (English)
 
An Intelligent Storage?
An Intelligent Storage?An Intelligent Storage?
An Intelligent Storage?
 
20170127 JAWS HPC-UG#8
20170127 JAWS HPC-UG#820170127 JAWS HPC-UG#8
20170127 JAWS HPC-UG#8
 
GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)GPGPU Accelerates PostgreSQL (English)
GPGPU Accelerates PostgreSQL (English)
 
PL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
PL/CUDA - Fusion of HPC Grade Power with In-Database AnalyticsPL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
PL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
 
Convolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in TheanoConvolutional Neural Network (CNN) presentation from theory to code in Theano
Convolutional Neural Network (CNN) presentation from theory to code in Theano
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
 

Similar to Task Parallel Library (TPL)

Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to PracticeWorkflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Frederic Desprez
 
Samples of competitive examination questions: part II
Samples of competitive examination questions: part IISamples of competitive examination questions: part II
Samples of competitive examination questions: part II
Ali I. Al-Mosawi
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building and
cseij
 

Similar to Task Parallel Library (TPL) (20)

Prueba de conociemientos Fullsctack NET v2.docx
Prueba de conociemientos  Fullsctack NET v2.docxPrueba de conociemientos  Fullsctack NET v2.docx
Prueba de conociemientos Fullsctack NET v2.docx
 
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to PracticeWorkflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
Workflow Allocations and Scheduling on IaaS Platforms, from Theory to Practice
 
Pipelining and vector processing
Pipelining and vector processingPipelining and vector processing
Pipelining and vector processing
 
BDS_QA.pdf
BDS_QA.pdfBDS_QA.pdf
BDS_QA.pdf
 
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
【Unite 2017 Tokyo】C#ジョブシステムによるモバイルゲームのパフォーマンス向上テクニック
 
computer networking
computer networkingcomputer networking
computer networking
 
GCF
GCFGCF
GCF
 
Java multi thread programming on cmp system
Java multi thread programming on cmp systemJava multi thread programming on cmp system
Java multi thread programming on cmp system
 
Parallel computation
Parallel computationParallel computation
Parallel computation
 
Samples of competitive examination questions: part II
Samples of competitive examination questions: part IISamples of competitive examination questions: part II
Samples of competitive examination questions: part II
 
as soon as possible 2. a. Windows named pipe i. Cant be used ov.pdf
as soon as possible  2. a. Windows named pipe i. Cant be used ov.pdfas soon as possible  2. a. Windows named pipe i. Cant be used ov.pdf
as soon as possible 2. a. Windows named pipe i. Cant be used ov.pdf
 
Oop suplemnertary september 2019
Oop suplemnertary september  2019Oop suplemnertary september  2019
Oop suplemnertary september 2019
 
Parallel Computing: Perspectives for more efficient hydrological modeling
Parallel Computing: Perspectives for more efficient hydrological modelingParallel Computing: Perspectives for more efficient hydrological modeling
Parallel Computing: Perspectives for more efficient hydrological modeling
 
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
CSE5656 Complex Networks - Location Correlation in Human Mobility, Implementa...
 
MERIMeeting du 27 mai 2014 - Parallel Programming
MERIMeeting du 27 mai 2014 - Parallel ProgrammingMERIMeeting du 27 mai 2014 - Parallel Programming
MERIMeeting du 27 mai 2014 - Parallel Programming
 
Srushti_M.E_PPT.ppt
Srushti_M.E_PPT.pptSrushti_M.E_PPT.ppt
Srushti_M.E_PPT.ppt
 
Concurrency in c#
Concurrency in c#Concurrency in c#
Concurrency in c#
 
Multithreading and concurrency in android
Multithreading and concurrency in androidMultithreading and concurrency in android
Multithreading and concurrency in android
 
Concurrency and parallel in .net
Concurrency and parallel in .netConcurrency and parallel in .net
Concurrency and parallel in .net
 
A survey of paradigms for building and
A survey of paradigms for building andA survey of paradigms for building and
A survey of paradigms for building and
 

Recently uploaded

THE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptx
THE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptxTHE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptx
THE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptx
ANSARKHAN96
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
NazaninKarimi6
 
Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.
Silpa
 
POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.
Silpa
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptx
Silpa
 
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
Scintica Instrumentation
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptx
Silpa
 

Recently uploaded (20)

GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
GBSN - Biochemistry (Unit 2) Basic concept of organic chemistry
 
THE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptx
THE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptxTHE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptx
THE ROLE OF BIOTECHNOLOGY IN THE ECONOMIC UPLIFT.pptx
 
FAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceFAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical Science
 
Zoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdfZoology 5th semester notes( Sumit_yadav).pdf
Zoology 5th semester notes( Sumit_yadav).pdf
 
development of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virusdevelopment of diagnostic enzyme assay to detect leuser virus
development of diagnostic enzyme assay to detect leuser virus
 
Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.
 
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRingsTransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
TransientOffsetin14CAftertheCarringtonEventRecordedbyPolarTreeRings
 
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICEPATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
PATNA CALL GIRLS 8617370543 LOW PRICE ESCORT SERVICE
 
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.Molecular markers- RFLP, RAPD, AFLP, SNP etc.
Molecular markers- RFLP, RAPD, AFLP, SNP etc.
 
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptxClimate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
Climate Change Impacts on Terrestrial and Aquatic Ecosystems.pptx
 
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS  ESCORT SERVICE In Bhiwan...
Bhiwandi Bhiwandi ❤CALL GIRL 7870993772 ❤CALL GIRLS ESCORT SERVICE In Bhiwan...
 
POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.POGONATUM : morphology, anatomy, reproduction etc.
POGONATUM : morphology, anatomy, reproduction etc.
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptx
 
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
(May 9, 2024) Enhanced Ultrafast Vector Flow Imaging (VFI) Using Multi-Angle ...
 
Role of AI in seed science Predictive modelling and Beyond.pptx
Role of AI in seed science  Predictive modelling and  Beyond.pptxRole of AI in seed science  Predictive modelling and  Beyond.pptx
Role of AI in seed science Predictive modelling and Beyond.pptx
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptx
 
Call Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort ServiceCall Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort Service
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
Gwalior ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Gwalior ESCORT SERVICE❤CALL GIRL
Gwalior ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Gwalior ESCORT SERVICE❤CALL GIRLGwalior ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Gwalior ESCORT SERVICE❤CALL GIRL
Gwalior ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Gwalior ESCORT SERVICE❤CALL GIRL
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 

Task Parallel Library (TPL)

  • 1. Submitted to Sir. Bilal Shahzad Submitted by BCSF13A024 BCSF13A034 BCSF13A039 Presentation Video https://youtu.be/kZKPIdLCWUc Degree BS (CS) Punjab University College of Information Technology, Lahore
  • 2. MCQS 1) Thread pool is used to ________. Select correct option: A. To make easy the process of thread creation B. To make easy debugging process C. To save time of thread creation D. To avoid complexity. 2) Thread pool creates or reduces real threads using a hillclimbing algo to ______. Select correct option: A. To maximize CUP usage B. To reduce the cost of thread creation C. To maximize memory utilization D. To minimize CPU usage 3) While dealing with "threads" in ".Net", one can avoid performance bottlenecks and enhance the overall responsiveness of his / her application by using _____________ programming. Select correct option: A. Multithreading programming B. Synchronous programming C. Parallel programming D. Asynchronous programming 4) Which of the following is correct way to temporarily stop execution of a thread object named as "myThread" for 500 milisec? A. myThread.Sleep(0.05); B. myThread.Stop(0.05); C. myThread.Sleep(500); D. myThread.Stop(500);
  • 3. 5) ______________ is more than one thing happening at the same time. Select correct option: A. Cohesion B. Congruence C. Coherence D. Concurrency 6) Which of the following class supports data parallelism in "Task Parallel Library"? Select correct option: A. System.Threading.Tasks B. System.Task.Parallel C. System.threading.Task.Parallel D. System.Task.Threading.Parallel 7) The "Task Based Asynchronous pattern" method returns either a "Task" or a "Task<TResult>", based on whether the corresponding __________ method returns "void" or a type "TResult". A. Callback B. Return C. Asynchronous D. Synchronous 8) Which of the following is not a part of "cancellation" task? A. The calling thread does forcibly end the task B. Notice and respond to the cancellation request in your user delegate C. Pass a cancellation token to your user delegate and optionally to the task instance D. Create and start a cancelable task
  • 4. 9) Which of the following is not handled by the “Task Parallel Library (TPL)”? A. Partitioning of the work B. Progress report handling C. Scheduling of threads D. Scales the degree of concurrency 10) Observe the following piece of code taken out from Main() function: Thread myThread = new Thread (Go); myThread.Strat(); myThread.Join(); What will be the effect Of instruction myThread.Join()? A. Execution of myThread will be joined with existing running threads B. myThread will be executed after Main thread is completed C. Main thread execution will be suspended till completion of myThread D. Both Main thread and myThread can now share the data 11) The Task Parallel Library introduces the concept of _________ A. Task B. Thread C. Files D. Multithreading 12) Why Task Parallel Library uses tasks instead of threads A. Threads consists of context switching B. Thread Creation is costly C. It uses the Thread Pool under the hood, in order to distribute the work D. All of the above
  • 5. 13) Which of the following class supports "Task Parallel Library"? Select correct option: A. System.Threading.Tasks B. System.Task.Parallel C. System.threading.Task.Parallel D. System.Task.Threading.Parallel 14) How we create a new task? A. Task t1 B. Task t1 = new Task() C. Task t1 = new Task(action) D. None of the above 15) How we can wait for a task to finish? E. Task.Join(task1) F. Task.Wait(task1) G. Task.Exit() H. None of the above 16) How we can wait for all tasks to finish A. Task.JoinAll(task1) B. Task.WaitAll(task1,task2,task3) C. Task.ExitAll() D. None of the above 17) In which .NET framework Task Parallel Library was introduced A. 1.0 B. 2.0 C. 3.0 D. 4.0
  • 6. 18) How to invoke more than one actions in parallel? A. Invoke(a1,a2,a3) B. Parallel(a1,a2,a3) C. Task.Parallel(a1,a2,a3) D. Parallel.Invoke(a1,a2,a3) 19) What is Parallel.For loop? A. Parallel.For loop is used for Parallelism, which is taking a certain task and dividing it into a set of related tasks to be executed concurrently. B. Same as for loop, which is used for task. C. Parallel.For loop is used for Parallelism, which is taking a certain threads and dividing it into a set of related threads to be executed concurrently. D. Both A and C. 20) What is the parallel implementation of LINQ to Objects? A. LINQ B. LINQ to tasks C. LINQ to Parallel D. PLINQ 21) In .NET, a task that doesn’t return a value is represented by the ____________ A. System.Threading.Tasks.Task<TResult> B. System.Threading.Tasks.Task C. System.Threading.Tasks D. None of the above. 22) In .NET a Task represents an __________ operation. A. Synchronous B. Asynchronous C. Parallel D. Callback 23) How to create a continuation that executes asynchronously when the target Task completes? A. Task(Action<Task>) B. Task.Continue(Action<Task>) C. Task.ContinueWith(Action<Task>) D. Both A and C
  • 7. 24) How to release all resources used by a particular instance of task? A. task.Destroy() B. task.Exit() C. task.Release() D. task.Dispose() 25) How to run a created task after a particular delay A. task.Start(10) B. task.Create(10) C. task.Delay(10) D. task.Join(10) 26) The Task Parallel Library (TPL) is a set of public types and APIs in the namespace: a. System.Threading b. System.Data c. System.Resources d. System.Management 27) A difference between threads and tasks: a. Time slicing is used for tasks whereas threads run simultaneously b. Time slicing is used for threads whereas tasks run simultaneously c. Threads utilize the complete power of multicores whereas tasks don’t d. Both b and c 28) Which of the following is not a state of the task: a. Faulted b. Canceled c. Completed d. Zombie 29) How to run the Task synchronously on the current TaskScheduler. A. task.run(synchrnous) B. task.sync() C. task.synchronous() D. task.RunSynchronously()
  • 8. 30) How to get the unique ID of currently executing task. A. task.id B. task.GetID() C. task.CurrentId D. None of the above. REFERENCE https://msdn.microsoft.com/en-us/library/system.threading.tasks.task%28v=vs.100%29.aspx https://msdn.microsoft.com/en-us/library/dd537609(v=vs.110).aspx http://vustudents.ning.com/group/cs411-visual-programming/forum/topics/quiz-4-february- 27-2015-february-27-2015-from-32-to-42- lectures?commentId=3783342%3AComment%3A4947917&xg_source=activity&groupId=3 783342%3AGroup%3A4194109