Debugging In a Multi- Threads Program. Contents 1 2 3 4 Advantages Of Multithreaded Programs Characteristics Of Sequential and Multithreaded Programs.

Slides:



Advertisements
Similar presentations
Multiprocessors— Large vs. Small Scale Multiprocessors— Large vs. Small Scale.
Advertisements

Structure of Computer Systems
Enter question text... 1.Enter answer text.... Enter question text... 1.Enter answer text...
Ade Azurat, Advanced Programming 2004 (Based on LYS Stefanus’s slides) Advanced Programming 2004, Based on LYS Stefanus’s slides Slide 2.1 Multithreading.
Sequential Logic Latches and Flip-Flops. Sequential Logic Circuits The output of sequential logic circuits depends on the past history of the state of.
Multithreaded Programs in Java. Tasks and Threads A task is an abstraction of a series of steps – Might be done in a separate thread – Java libraries.
Professor: Shu-Ching Chen TA: Hsin-Yu Ha.  An independent stream of instructions that can be scheduled to run  A path of execution int a, b; int c;
Enter question text... 1.Enter answer text.... Enter question text... 1.Enter answer text...
Hadi JooybarGPUDet: A Deterministic GPU Architecture1 Hadi Jooybar 1, Wilson Fung 1, Mike O’Connor 2, Joseph Devietti 3, Tor M. Aamodt 1 1 The University.
Cpr E 308 Spring 2004 Recap for Midterm Introductory Material What belongs in the OS, what doesn’t? Basic Understanding of Hardware, Memory Hierarchy.
COS 461 Fall 1997 Concurrent Programming u Traditional programs do one thing at a time. u Concurrent programs do several things at once. u Why do this?
System Programming Practical Session 5 Liveness, Guarded Methods, and Thread Timing.
Instruction Level Parallelism (ILP) Colin Stevens.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
5.6.2 Thread Synchronization with Semaphores Semaphores can be used to notify other threads that events have occurred –Producer-consumer relationship Producer.
CS603 Process Synchronization February 11, Synchronization: Basics Problem: Shared Resources –Generally data –But could be others Approaches: –Model.
Chapter 6 – Concurrent Programming Outline 6.1 Introduction 6.2Monitors 6.2.1Condition Variables 6.2.2Simple Resource Allocation with Monitors 6.2.3Monitor.
How Multi-threading can increase on-chip parallelism
CS Distributed Computing Systems Chin-Chih Chang, An Introduction to Threads.
1 Interprocess Communication Race Conditions Two processes want to access shared memory at same time.
Topic ? Course Overview. Guidelines Questions are rated by stars –One Star Question  Easy. Small definition, examples or generic formulas –Two Stars.
Process Synchronization Ch. 4.4 – Cooperating Processes Ch. 7 – Concurrency.
Why The Grass May Not Be Greener On The Other Side: A Comparison of Locking vs. Transactional Memory Written by: Paul E. McKenney Jonathan Walpole Maged.
50.003: Elements of Software Construction Week 5 Basics of Threads.
Deterministic Replay of Java Multithreaded Applications Jong-Deok Choi and Harini Srinivasan slides made by Qing Zhang.
Thinking in Parallel Adopting the TCPP Core Curriculum in Computer Systems Principles Tim Richards University of Massachusetts Amherst.
COLLEGE FOR PROFESSIONAL STUDIES TOPIC OF PRESENTATION PROCESSOR IN COMPUTER.
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Destroy the Castle – Example Instructions. Functional Decomposition2 Lab 1 Activity 1 Build, Run, and Benchmark.
Analyzing parallel programs with Pin Moshe Bach, Mark Charney, Robert Cohn, Elena Demikhovsky, Tevi Devor, Kim Hazelwood, Aamer Jaleel, Chi- Keung Luk,
Multi-Threaded Application CSNB534 Asma Shakil. Overview Software applications employ a strategy called multi- threaded programming to split tasks into.
Quick overview of threads in Java Babak Esfandiari (extracted from Qusay Mahmoud’s slides)
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
Java Threads 11 Threading and Concurrent Programming in Java Introduction and Definitions D.W. Denbo Introduction and Definitions D.W. Denbo.
Threads Concurrency in Java. What is mult-tasking? Doing more than one task.
111 © 2002, Cisco Systems, Inc. All rights reserved.
CS 152: Programming Language Paradigms May 7 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak
1 Multithreaded Programming Concepts Myongji University Sugwon Hong 1.
Spring 2003CSE P5481 Midterm Philosophy What the exam looks like. Definitions, comparisons, advantages & disadvantages what is it? how does it work? why.
OpenRISC 1000 Yung-Luen Lan, b Cache Model Perspective of the Programming Model. Hence, the hardware implementation details (cache organization.
Professor: Shu-Ching Chen TA: Samira Pouyanfar.  An independent stream of instructions that can be scheduled to run  A path of execution int a, b; int.
15.1 Threads and Multi- threading Understanding threads and multi-threading In general, modern computers perform one task at a time It is often.
Thread Level Parallelism Since ILP has inherent limitations, can we exploit multithreading? –a thread is defined as a separate process with its own instructions.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Concurrency & Dynamic Programming.
HXY Debugging Made by Contents 目录 History of Java MT Sequential & Parallel Different types of bugs Debugging skills.
1 Based on: The art of multiprocessor programming Maurice Herlihy and Nir Shavit, 2008 Appendix A – Software Basics Appendix B – Hardware Basics Introduction.
Presented by PLASMA (Parallel Linear Algebra for Scalable Multicore Architectures) ‏ The Innovative Computing Laboratory University of Tennessee Knoxville.
Presented by PLASMA (Parallel Linear Algebra for Scalable Multicore Architectures) ‏ The Innovative Computing Laboratory University of Tennessee Knoxville.
1 Ivan Marsic Rutgers University LECTURE 19: Concurrent Programming.
Code Development for High Performance Servers Topics Multithreaded Servers Event Driven Servers Example - Game Server code (Quake) A parallelization exercise.
Chapter 6 Programming l Problem solving l Debugging.
Hongbin Li 11/13/2014 A Debugger of Parallel Mutli- Agent Spatial Simulation.
CS203 Programming with Data Structures Introduction to Threads and Synchronization California State University, Los Angeles.
Java.util.concurrent package. concurrency utilities packages provide a powerful, extensible framework of high-performance threading utilities such as.
Threads in Java Jaanus Pöial, PhD Tallinn, Estonia.
Multi Threading.
Multi-core processors
Multithreaded Programming in Java
Multi-core processors
Definitions Concurrent program – Program that executes multiple instructions at the same time. Process – An executing program (the running JVM for Java.
Setac: A Phased Deterministic Testing Framework for Scala Actors
Multithreading Tutorial
Chapter 4 Multithreading programming
© 2002, Mike Murach & Associates, Inc.
Computer Architecture Lecture 4 17th May, 2006
Semaphore and Multithreading
Programming Problem solving Debugging
NETWORK PROGRAMMING CNET 441
Ch 3.
Chapter 3: Process Management
Presentation transcript:

Debugging In a Multi- Threads Program

Contents Advantages Of Multithreaded Programs Characteristics Of Sequential and Multithreaded Programs Why More Bugs And How to Prevent them How To Debug

1 Advantages Of Multithreaded Programs

Raise clock rate? “parallelism” ILP, Instruction Level Parallelism TLP, Thread Level Parallelism

2 Characteristics Of Sequential and Multithreaded Programs

Comparison

Sample Behavior is nondeterministic

3 Why More Bugs And How to Prevent them

Where Is Bug “ Out-Of-Order ”

Out-Of-Order sleep() Latch CyclicBarrier CountDownLatch latch = new CountDownLatch(3); countDown() await() CyclicBarrier cyclicBarrier = new CyclicBarrier(3); cyclicBarrier.await(); Producer-Consumer Mode wait() 、 notify() 、 notifyAll()

Where Is Bug Synchronization

Shared Memory Model Easy to understand Memory coherence is managed by the operating system

Synchronization synchronized Destroy parallelism

Where Is Bug Deadlock Other

4 How To Debug

1 breakpoint 2 3 logJPDA JDI ENTER TEXT