SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Objectives


                In this session, you will learn to:
                   Identify the benefits of multithreading
                   Design applications using threads




     Ver. 1.0                                                Slide 1 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Identifying the Benefits of Multithreading


                Multithreading increases the performance of your
                application by:
                   Performing multiple tasks in parallel
                   Better utilization of system resources
                   Increasing the speed of your application




     Ver. 1.0                                                      Slide 2 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Identifying the Benefits of Multithreading (Contd.)


                Thread is a sequential flow of control within a program.
                It is a sequence of instructions executed within a program.
                Every program consists of at least one thread, called the
                main thread.
                The main thread is responsible for initializing the programs.




     Ver. 1.0                                                         Slide 3 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Just a minute


                What is a thread?




                Answer:
                   A thread is a sequential flow of control within a program.




     Ver. 1.0                                                               Slide 4 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Identifying the Benefits of Multithreading (Contd.)


                The main benefits of threads are:
                   Increased performance
                   Better resource utilization
                   Simpler communication




     Ver. 1.0                                               Slide 5 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Identifying the Benefits of Multithreading (Contd.)


                The two inherent conditions of a multithreaded application
                are:
                ►   Concurrency            Concurrency refers to a situation in
                                           which one or more threads are in
                ►   Parallelism            Parallelism refers to the simultaneous
                                           progress simultaneously.
                                           execution of multiple tasks.
                                           In this case, the processor switches
                                           In a multithreaded application, which is
                                           from one thread to another during the
                                           running onof the application. system,
                                           execution a multiprocessor
                                           threads execute in parallel.




     Ver. 1.0                                                                    Slide 6 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Designing Applications Using Threads


                The best time for threading an application is during its
                design phase.
                During the design phase, you can accommodate all the data
                and code restructuring related to threading.
                   This reduces the overall effort during the application
                   development.
                A program comprising of multiple independent activities can
                be redesigned in such a manner so that each activity can
                be defined as a separate thread.
                   This enables you to decompose your work into simple
                   independent activities and improve the functionality and
                   performance of your application.




     Ver. 1.0                                                               Slide 7 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Designing Applications Using Threads (Contd.)


                You can improve the functionality of your application by
                assigning different threads to different functions of the
                application.
                By assigning a separate thread to each function, all the
                functions can execute independent of each other.
                This approach makes the application more efficient because
                threading is easier than switching functions within a serial
                code.




     Ver. 1.0                                                       Slide 8 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Designing Applications Using Threads (Contd.)


                Performance of an application depends upon the
                combination of various factors such as speed and utilization
                of system resources.
                   A multithreaded application running on a single processor
                   system leads to a better utilization of system resources.
                   A multithreaded application running on a multiprocessor
                   system leads to better utilization of system resources and
                   increased speed of the application.




     Ver. 1.0                                                             Slide 9 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Just a minute


                How does the use of threads improve the functionality of an
                application?




                Answer:
                   Threads improve the functionality of an application by
                   assigning different threads to different functions. This makes it
                   easier to control the execution of multiple functions within an
                   application.



     Ver. 1.0                                                               Slide 10 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Designing Applications Using Threads (Contd.)


                Data decomposition refers to the process of:
                    Breaking down a program into logical chunks or individual
                    tasks.
                    Identifying the dependencies between the tasks.
                The two types of decomposition methods are:
                ►   Task decomposition          It refers to the process of decomposing
                                                a program on the basis of the functions
                ►   Data decomposition          It performs. process of decomposing
                                                it refers to the
                                                an application in such a way so that the
                                                It is also known as functional
                                                same operation is performed
                                                decomposition.
                                                repeatedly for different data.
                                                In this case, you can assign separate
                                                threads to the independent functions in
                                                your program.




     Ver. 1.0                                                                    Slide 11 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Identifying the Complexities Involved in Multithreaded Applications


                In a multithreaded application, you need to take care of
                various complexities, which may arise during thread
                interaction. These complexities are:
                ►   Race conditions        Race conditions occur when the output
                                           of the program depends upon which
                ►   Critical region        Critical region refers to those portions
                                           thread reaches a particular block of
                                           of your application that access shared
                ►   Mutual exclusion       code first.
                                           Mutual exclusion allows only one
                                           variables.
                                           thread to be executingto different
                                           Race conditions lead in a critical
                ►   Synchronization        Synchronization controls the relative
                                           region at a given time.
                                           results every time a program is
                                           order of thread execution and resolves
                ►   Deadlocks              executed. refersis executing the code
                                           When a thread to a threads. in which
                                           Deadlock
                                           any conflicts among situation
                                           that accesses a shared resource in a
                                           a thread waits for abased on the can
                                           Synchronization is condition that
                                           criticaloccur. any other thread that
                                           never region,
                                           concept of monitoring.
                                           might desire entry to the critical region
                                           Deadlock halts the execution of your
                                           must wait to access that region.
                                           application preventing it to continue
                                           further.




     Ver. 1.0                                                                    Slide 12 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Just a minute


                List the complexities involved in a multithreaded application.




                Answer:
                   The complexities involved in a multithreaded application are as
                   follows:
                       Race conditions
                       Critical region
                       Mutual exclusion
                       Synchronization
                       Deadlocks

     Ver. 1.0                                                             Slide 13 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Activity: Analyzing the Processor Activity During Deadlock


                Problem Statement:
                   John has developed a code in C# in which he acquires a lock
                   on two resources. However on execution, the application
                   comes to a halt after some time. He wants to analyze the
                   processor utilization on his system using the counter monitor
                   feature of VTune. Help John to accomplish his task.




     Ver. 1.0                                                            Slide 14 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Activity: Analyzing the Processor Activity During Deadlock (Contd.)


                Solution
                   To analyze the performance of the application, you need to
                   perform the following tasks:
                    1. Configure counter monitor using the counter monitor configuration
                       wizard.
                    2. Analyze the processor utilization on the system.




     Ver. 1.0                                                                  Slide 15 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Summary


                In this session, you learned that:
                   You can improve the speed of your application to a great
                   extent by using multiple threads in your application.
                   A thread is a sequential flow of control within a program.
                   The main benefits of threads are as follows:
                     • Increased performance
                     • Better resource utilization
                     • Simpler communication
                 • In a multithreaded application, threads run concurrently or in
                   parallel.
                 • You can improve the functionality of your application by
                   assigning different threads to different functions of the
                   application. These functions may or may not be dependant on
                   each other.



     Ver. 1.0                                                              Slide 16 of 17
Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation

Summary (Contd.)


                The threads enable you to improve the performance of your
                application.
                The process of breaking down a program into logical chunks or
                individual tasks and identifying the dependencies between
                them is referred to as decomposition.
                In a multithreaded application, you need to take care of various
                complexities that may arise during thread interaction. These
                complexities are as follows:
                    Race condition
                    Critical region
                    Mutual exclusion
                    Synchronization
                    Deadlock




     Ver. 1.0                                                          Slide 17 of 17

Weitere ähnliche Inhalte

Was ist angesagt?

Moxa Tech White Paper - Choosing An Embedded Operating System
Moxa Tech White Paper - Choosing An Embedded Operating SystemMoxa Tech White Paper - Choosing An Embedded Operating System
Moxa Tech White Paper - Choosing An Embedded Operating SystemDigital River
 
Tolly report: Trend Micro Deep Security 7.5 vs. McAfee and Symantec
Tolly report: Trend Micro Deep Security 7.5 vs. McAfee and SymantecTolly report: Trend Micro Deep Security 7.5 vs. McAfee and Symantec
Tolly report: Trend Micro Deep Security 7.5 vs. McAfee and SymantecUNIT4 IT Solutions
 
13.30 hr Hebinck
13.30 hr Hebinck13.30 hr Hebinck
13.30 hr HebinckThemadagen
 
Hosted Virtualization
Hosted VirtualizationHosted Virtualization
Hosted Virtualizationjayallen77
 
Antivirus Scanning Performance and System Resource Utilization Comparison
Antivirus Scanning Performance and System Resource Utilization ComparisonAntivirus Scanning Performance and System Resource Utilization Comparison
Antivirus Scanning Performance and System Resource Utilization ComparisonGFI Software
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsNational Cheng Kung University
 
Operating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and DisadvantagesOperating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and DisadvantagesFatih Özlü
 
Intel vmcs-shadowing-paper
Intel vmcs-shadowing-paperIntel vmcs-shadowing-paper
Intel vmcs-shadowing-paperAhmed Sallam
 
11 intel v_tune_session_16
11 intel v_tune_session_1611 intel v_tune_session_16
11 intel v_tune_session_16Niit Care
 

Was ist angesagt? (12)

Moxa Tech White Paper - Choosing An Embedded Operating System
Moxa Tech White Paper - Choosing An Embedded Operating SystemMoxa Tech White Paper - Choosing An Embedded Operating System
Moxa Tech White Paper - Choosing An Embedded Operating System
 
Tolly report: Trend Micro Deep Security 7.5 vs. McAfee and Symantec
Tolly report: Trend Micro Deep Security 7.5 vs. McAfee and SymantecTolly report: Trend Micro Deep Security 7.5 vs. McAfee and Symantec
Tolly report: Trend Micro Deep Security 7.5 vs. McAfee and Symantec
 
580 584
580 584580 584
580 584
 
13.30 hr Hebinck
13.30 hr Hebinck13.30 hr Hebinck
13.30 hr Hebinck
 
Hosted Virtualization
Hosted VirtualizationHosted Virtualization
Hosted Virtualization
 
intouch
intouchintouch
intouch
 
Windows CE
Windows CEWindows CE
Windows CE
 
Antivirus Scanning Performance and System Resource Utilization Comparison
Antivirus Scanning Performance and System Resource Utilization ComparisonAntivirus Scanning Performance and System Resource Utilization Comparison
Antivirus Scanning Performance and System Resource Utilization Comparison
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 
Operating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and DisadvantagesOperating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
Operating System Windows CE 7.0 and Processor ARM Advantages and Disadvantages
 
Intel vmcs-shadowing-paper
Intel vmcs-shadowing-paperIntel vmcs-shadowing-paper
Intel vmcs-shadowing-paper
 
11 intel v_tune_session_16
11 intel v_tune_session_1611 intel v_tune_session_16
11 intel v_tune_session_16
 

Ähnlich wie 09 intel v_tune_session_13

09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13Vivek chan
 
10 intel v_tune_session_14
10 intel  v_tune_session_1410 intel  v_tune_session_14
10 intel v_tune_session_14Niit Care
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10Niit Care
 
05 intel v_tune_session_07
05 intel v_tune_session_0705 intel v_tune_session_07
05 intel v_tune_session_07Niit Care
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05Niit Care
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3Diane Allen
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasVikash Chandra Das
 
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP ProgrammingHetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP ProgrammingIntel® Software
 
Comp tia n+_session_11
Comp tia n+_session_11Comp tia n+_session_11
Comp tia n+_session_11Niit Care
 
Faster deep learning solutions from training to inference - Michele Tameni - ...
Faster deep learning solutions from training to inference - Michele Tameni - ...Faster deep learning solutions from training to inference - Michele Tameni - ...
Faster deep learning solutions from training to inference - Michele Tameni - ...Codemotion
 
Addressing New Challenges in Software Protection for .NET
Addressing New Challenges in Software Protection for .NETAddressing New Challenges in Software Protection for .NET
Addressing New Challenges in Software Protection for .NETLicensingLive! - SafeNet
 
Binary translation
Binary translationBinary translation
Binary translationGFI Software
 
Zenon The integrated solution
Zenon The integrated solutionZenon The integrated solution
Zenon The integrated solutionCopa-Data UK
 
A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS
A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS
A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS MOHAMMED FURQHAN
 
Factors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxFactors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxZain Abid
 

Ähnlich wie 09 intel v_tune_session_13 (20)

09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
 
10 intel v_tune_session_14
10 intel  v_tune_session_1410 intel  v_tune_session_14
10 intel v_tune_session_14
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10
 
05 intel v_tune_session_07
05 intel v_tune_session_0705 intel v_tune_session_07
05 intel v_tune_session_07
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3
 
An isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra dasAn isas presentation on .net framework 2.0 by vikash chandra das
An isas presentation on .net framework 2.0 by vikash chandra das
 
10 gui 14
10 gui 1410 gui 14
10 gui 14
 
Explore asp.net core 3.0 features
Explore asp.net core 3.0 featuresExplore asp.net core 3.0 features
Explore asp.net core 3.0 features
 
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP ProgrammingHetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
Hetergeneous Compute with Standards Based OFI/MPI/OpenMP Programming
 
Comp tia n+_session_11
Comp tia n+_session_11Comp tia n+_session_11
Comp tia n+_session_11
 
Faster deep learning solutions from training to inference - Michele Tameni - ...
Faster deep learning solutions from training to inference - Michele Tameni - ...Faster deep learning solutions from training to inference - Michele Tameni - ...
Faster deep learning solutions from training to inference - Michele Tameni - ...
 
Addressing New Challenges in Software Protection for .NET
Addressing New Challenges in Software Protection for .NETAddressing New Challenges in Software Protection for .NET
Addressing New Challenges in Software Protection for .NET
 
Developing on Windows 8
Developing on Windows 8Developing on Windows 8
Developing on Windows 8
 
Anti Key Logging And Real Time Encryption Software
Anti Key Logging And Real Time Encryption SoftwareAnti Key Logging And Real Time Encryption Software
Anti Key Logging And Real Time Encryption Software
 
Binary translation
Binary translationBinary translation
Binary translation
 
Zenon The integrated solution
Zenon The integrated solutionZenon The integrated solution
Zenon The integrated solution
 
A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS
A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS
A CASE STUDY ON EMBEDDED SYSTEM SOFTWARE STACK LAYERS
 
About .net
About .net About .net
About .net
 
Factors Affecting the System Safety || Linux
Factors Affecting the System Safety || LinuxFactors Affecting the System Safety || Linux
Factors Affecting the System Safety || Linux
 

Mehr von Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Kürzlich hochgeladen

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Kürzlich hochgeladen (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

09 intel v_tune_session_13

  • 1. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Objectives In this session, you will learn to: Identify the benefits of multithreading Design applications using threads Ver. 1.0 Slide 1 of 17
  • 2. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Identifying the Benefits of Multithreading Multithreading increases the performance of your application by: Performing multiple tasks in parallel Better utilization of system resources Increasing the speed of your application Ver. 1.0 Slide 2 of 17
  • 3. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Identifying the Benefits of Multithreading (Contd.) Thread is a sequential flow of control within a program. It is a sequence of instructions executed within a program. Every program consists of at least one thread, called the main thread. The main thread is responsible for initializing the programs. Ver. 1.0 Slide 3 of 17
  • 4. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Just a minute What is a thread? Answer: A thread is a sequential flow of control within a program. Ver. 1.0 Slide 4 of 17
  • 5. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Identifying the Benefits of Multithreading (Contd.) The main benefits of threads are: Increased performance Better resource utilization Simpler communication Ver. 1.0 Slide 5 of 17
  • 6. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Identifying the Benefits of Multithreading (Contd.) The two inherent conditions of a multithreaded application are: ► Concurrency Concurrency refers to a situation in which one or more threads are in ► Parallelism Parallelism refers to the simultaneous progress simultaneously. execution of multiple tasks. In this case, the processor switches In a multithreaded application, which is from one thread to another during the running onof the application. system, execution a multiprocessor threads execute in parallel. Ver. 1.0 Slide 6 of 17
  • 7. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Designing Applications Using Threads The best time for threading an application is during its design phase. During the design phase, you can accommodate all the data and code restructuring related to threading. This reduces the overall effort during the application development. A program comprising of multiple independent activities can be redesigned in such a manner so that each activity can be defined as a separate thread. This enables you to decompose your work into simple independent activities and improve the functionality and performance of your application. Ver. 1.0 Slide 7 of 17
  • 8. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Designing Applications Using Threads (Contd.) You can improve the functionality of your application by assigning different threads to different functions of the application. By assigning a separate thread to each function, all the functions can execute independent of each other. This approach makes the application more efficient because threading is easier than switching functions within a serial code. Ver. 1.0 Slide 8 of 17
  • 9. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Designing Applications Using Threads (Contd.) Performance of an application depends upon the combination of various factors such as speed and utilization of system resources. A multithreaded application running on a single processor system leads to a better utilization of system resources. A multithreaded application running on a multiprocessor system leads to better utilization of system resources and increased speed of the application. Ver. 1.0 Slide 9 of 17
  • 10. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Just a minute How does the use of threads improve the functionality of an application? Answer: Threads improve the functionality of an application by assigning different threads to different functions. This makes it easier to control the execution of multiple functions within an application. Ver. 1.0 Slide 10 of 17
  • 11. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Designing Applications Using Threads (Contd.) Data decomposition refers to the process of: Breaking down a program into logical chunks or individual tasks. Identifying the dependencies between the tasks. The two types of decomposition methods are: ► Task decomposition It refers to the process of decomposing a program on the basis of the functions ► Data decomposition It performs. process of decomposing it refers to the an application in such a way so that the It is also known as functional same operation is performed decomposition. repeatedly for different data. In this case, you can assign separate threads to the independent functions in your program. Ver. 1.0 Slide 11 of 17
  • 12. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Identifying the Complexities Involved in Multithreaded Applications In a multithreaded application, you need to take care of various complexities, which may arise during thread interaction. These complexities are: ► Race conditions Race conditions occur when the output of the program depends upon which ► Critical region Critical region refers to those portions thread reaches a particular block of of your application that access shared ► Mutual exclusion code first. Mutual exclusion allows only one variables. thread to be executingto different Race conditions lead in a critical ► Synchronization Synchronization controls the relative region at a given time. results every time a program is order of thread execution and resolves ► Deadlocks executed. refersis executing the code When a thread to a threads. in which Deadlock any conflicts among situation that accesses a shared resource in a a thread waits for abased on the can Synchronization is condition that criticaloccur. any other thread that never region, concept of monitoring. might desire entry to the critical region Deadlock halts the execution of your must wait to access that region. application preventing it to continue further. Ver. 1.0 Slide 12 of 17
  • 13. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Just a minute List the complexities involved in a multithreaded application. Answer: The complexities involved in a multithreaded application are as follows: Race conditions Critical region Mutual exclusion Synchronization Deadlocks Ver. 1.0 Slide 13 of 17
  • 14. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Activity: Analyzing the Processor Activity During Deadlock Problem Statement: John has developed a code in C# in which he acquires a lock on two resources. However on execution, the application comes to a halt after some time. He wants to analyze the processor utilization on his system using the counter monitor feature of VTune. Help John to accomplish his task. Ver. 1.0 Slide 14 of 17
  • 15. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Activity: Analyzing the Processor Activity During Deadlock (Contd.) Solution To analyze the performance of the application, you need to perform the following tasks: 1. Configure counter monitor using the counter monitor configuration wizard. 2. Analyze the processor utilization on the system. Ver. 1.0 Slide 15 of 17
  • 16. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Summary In this session, you learned that: You can improve the speed of your application to a great extent by using multiple threads in your application. A thread is a sequential flow of control within a program. The main benefits of threads are as follows: • Increased performance • Better resource utilization • Simpler communication • In a multithreaded application, threads run concurrently or in parallel. • You can improve the functionality of your application by assigning different threads to different functions of the application. These functions may or may not be dependant on each other. Ver. 1.0 Slide 16 of 17
  • 17. Code Optimization and Performance Tuning Using Intel VTune Installing Windows XP Professional Using Attended Installation Summary (Contd.) The threads enable you to improve the performance of your application. The process of breaking down a program into logical chunks or individual tasks and identifying the dependencies between them is referred to as decomposition. In a multithreaded application, you need to take care of various complexities that may arise during thread interaction. These complexities are as follows: Race condition Critical region Mutual exclusion Synchronization Deadlock Ver. 1.0 Slide 17 of 17

Hinweis der Redaktion

  1. Begin the session by sharing the objectives with the students.
  2. Begin the session by sharing the objectives with the students.
  3. Explain the matrix multiplication example in which every element can computed separately by a thread. Also tell the students that improper use of threads can degrade the performance of the application.
  4. Initiate a discussion on the benefits of threads. Tell the students that at a time, the processor can execute only one thread. Next, discuss the concept of time slicing in a threaded application. Explain the concept of time slicing by giving the example of a gaming application as given in the SG. Tell the students that implementing time slicing in a threaded application keeps the processor busy. It gives an impression as if multiple threads are running at the same time.
  5. Discuss the concept of concurrency and parallelism in a threaded application. Tell the students that on a single processor system, threads run concurrently and in a multiprocessor system, threads can run concurrently as well as parallely.
  6. Tell the students that design phase of an application is the best time to incorporate multithreading. This reduces the overall effort in application development process.
  7. Explain the students that a multithreaded application improves the functionality of an application by assigning threads to different functions in the application. You can explain the concept with the help of an example of the Outlook window given in the SG.
  8. Explain that the performance of a multithreaded application varies on a single processor and multiprocessor system. Refer to the SG for the same. Next, explain the students that performance of an application also depends upon various other factors. This may include the way files and databases have been organized. Refer to the SG for the same.
  9. Explain the concept of decomposition of work in an application. Next, explain task decomposition and data decomposition. Refer to the examples given in the SG relating to task and data decomposition.
  10. Initiate a discussion on various complexities involved in a multithreaded application. Ask the students to think of some complexities involved in a multithreaded application. Next, explain various complexities given in the slide. Explain each complexity by giving an example. Refer to the SG for the same.
  11. To demonstrate this activity, you can use the data files provided at the following locations: TIRM  Datafiles for Faculty  Chapter06  Activity01  Deadlock.zip Deadlock.zip file contains the optimized and the unoptimized codes. The faculty should first show the demonstration of the unoptimized code. After analyzing the processor activity, the faculty should again run the activity using the optimized code. This would enable the students comparing the results between the optimized and the unoptimized code.
  12. Summarize the session.
  13. Summarize the session.