3.8 static vs dynamic thread management

Slides:



Advertisements
Similar presentations
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Advertisements

Transition from C to C++ …and a Review of Basic Problem Solving.
Multilingual Debugging Support for Data-driven Parallel Languages Parthasarathy Ramachandran Laxmikant Kale Parallel Programming Laboratory Dept. of Computer.
Information Networking Security and Assurance Lab National Chung Cheng University Investigating Hacker Tools.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
CS533 Concepts of Operating Systems Class 2 The Duality of Threads and Events.
General Computer Science for Engineers CISC 106 Lecture 26 Dr. John Cavazos Computer and Information Sciences 04/24/2009.
CS 225 Lab #2 - Pointers, Copy Constructors, Destructors, and DDD.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
DEBUGGERS For CS302 Data Structures Course Slides prepared by TALHA OZ (most of the text is from
Multi-core Programming Thread Profiler. 2 Tuning Threaded Code: Intel® Thread Profiler for Explicit Threads Topics Look at Intel® Thread Profiler features.
Designing and Evaluating Parallel Programs Anda Iamnitchi Federated Distributed Systems Fall 2006 Textbook (on line): Designing and Building Parallel Programs.
Instructor Notes GPU debugging is still immature, but being improved daily. You should definitely check to see the latest options available before giving.
Which Language is Better?
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
This set of notes is adapted from that provided by “Computer Science – A Structured Programming Approach Using C++”, B.A. Forouzan & R.F. Gilberg, Thomson.
Computer Organization David Monismith CS345 Notes to help with the in class assignment.
Editing & Compiling: UNIX vs. IDE and an Intro to Architecture.
Games Development 2 Concurrent Programming CO3301 Week 9.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
CSE 332: C++ debugging Why Debug a Program? When your program crashes –Finding out where it crashed –Examining program memory at that point When a bug.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
OBSERVING FACTS AND TRACKING ORIGINS CEN PPT8.
Concurrent Computing CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
Byoung-Jo CHOI Fall 2007 SW Project II Advanced Linux Programming.
Parallelization Strategies Laxmikant Kale. Overview OpenMP Strategies Need for adaptive strategies –Object migration based dynamic load balancing –Minimal.
EEL 3801 C++ as an Enhancement of C. EEL 3801 – Lotzi Bölöni Comments  Can be done with // at the start of the commented line.  The end-of-line terminates.
17/02/2016S. Ponce / EP-LBC1 Debugging Under Linux Sebastien Ponce Friday, 8 March 2002.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
CPT: Debug/ Computer Programming Techniques Semester 1, 1998 Objective of these slides: –to talk about the various approaches to testing.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Tuning Threaded Code with Intel® Parallel Amplifier.
HP-SEE Debugging with GDB Vladimir Slavnic Research Assistant SCL, Institute of Physics Belgrade The HP-SEE initiative.
Reference Implementation of the High Performance Debugging (HPD) Standard Kevin London ( ) Shirley Browne ( ) Robert.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
Introduction To Software Development Environment.
Hongbin Li 11/13/2014 A Debugger of Parallel Mutli- Agent Spatial Simulation.
Using Ada-C/C++ Changer as a Converter Automatically convert to C/C++ to reuse or redeploy your Ada code Eliminate the need for a costly and.
Coupling and Cohesion Rajni Bhalla.
User-Written Functions
New Features in Dyninst 5.1
Faster parallel programs with improved FastMM
For Massively Parallel Computation The Chaotic State of the Art
SHARED MEMORY PROGRAMMING WITH OpenMP
Chapter 2: System Structures
Kernel Tracing David Ferry, Chris Gill
LESSON 20.
Performance Analysis, Tools and Optimization
Parallel Programming with MPI and OpenMP
Chapter 2: Operating-System Structures
Chapter 4: Threads.
Chapter 9 Classes: A Deeper Look, Part 1
Task Initiation Panel for SORCER Environment
How I Learned to Love FastMM Internals
CSE 403 Lecture 18 Debugging.
Ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014.
When your program crashes
Our Environment We will exercise on Microsoft Visual C++ v.6
Chapter 4 Threads, SMP, and Microkernels
Multithreading Why & How.
Chapter 4: Threads & Concurrency
Chapter 4: Threads.
Reviews “How’s it going?”
Chapter 4: Threads.
Ns-3 Training Debugging support ns-3 training, June 2016.
Debugging.
Presentation transcript:

3.8 static vs dynamic thread management QT provides a pool of threads, applications gain performance by reusing threads When a thread is needed, an idle thread is selected from the pool This is more efficient even though thread creation is orders of magnitude faster than process creation, thread creation still takes time. Example listing 3.25

Creating and Managing a pool of threads REQUIREMENTS Be able to describe computational tasks Communicate computational tasks Identify threads that are executing a task Signal the termination of a task’s execution

3.9Debugging Multithreaded Applications GDB and DDD (data display debugger, a front end to GDB or DBX) Compile with –g Often time sensitive affected by the debugger

Steps to ensure bug free applications Don’t introduce bugs Write bug free code Use a good design Use previously written programs adapted to specific application Create a log of programs execution Allow the threads to be variable Debugging 1 thread is easier than 10, 2 or 3 also easier

Printf or Cout Typically not sufficient Output is intermixed via the threads Can write to a file myprog 2> trace.log Use a high resolution timer to time stamp messages #define DEBUG #ifdef DEBUG ……… #endif

More debugging hints Disable compiler optimizations An optimization can (rarely) introduce bugs

Many example programs Qthreads Openmp MPI GPU