1HW13 Modify ThreadSafeBankAccount2 to use an assertion that checks a lock is released. Learn how to compile and run Java code with assertions. Define.

Slides:



Advertisements
Similar presentations
Java Control Statements
Advertisements

Practice Session 7 Synchronization Liveness Deadlock Starvation Livelock Guarded Methods Model Thread Timing Busy Wait Sleep and Check Wait and Notify.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Process Synchronization. Module 6: Process Synchronization Background The Critical-Section Problem Peterson’s Solution Synchronization Hardware Semaphores.
Trace-Based Automatic Parallelization in the Jikes RVM Borys Bradel University of Toronto.
Concurrency and Thread Yoshi. Two Ways to Create Thread Extending class Thread – Actually, we need to override the run method in class Thread Implementing.
Fine-Grain Parallelism MQPs for Hugh C. Lauer MQPs for Fine-Grain Parallelism1.
The Java Assert Statement. 2 Assert A Java statement in JDK 1.4 & newer Intent: enables code to test assumptions. E.g., a method that calculates a particle’s.
1 Introduction to ANT Written by James Duncan Davidson Like GNU Make but specifically for Java Good for bundling and delivery of groups of classes, jars,
CSC 395 – Software Engineering Lecture 24: Apache Ant –or– Programming the results of programming Based upon a talk by Anthony Wat.
Chapter 6 – Concurrent Programming Outline 6.1 Introduction 6.2Monitors 6.2.1Condition Variables 6.2.2Simple Resource Allocation with Monitors 6.2.3Monitor.
1 Fall 2008ACS-1903 for Loop Reading files String conversions Random class.
Lecturer: Dr. AJ Bieszczad Chapter 76-1 Software engineering standards Standards for you Standards for others Matching design with implementation.
OCT Information Systems Management 1 Lecture 2A Introduction to ANT Written by James Duncan Davidson. Like GNU Make but specifically for Java. Good.
Threading in Java – a Tutorial QMUL IEEE SB. Why Threading When we need to run two tasks concurrently So multiple parts (>=2) of a program can run simultaneously.
Concurrency: shared objects & mutual exclusion1 ©Magee/Kramer 2 nd Edition Chapter 4 Shared Objects & Mutual Exclusion.
2007 Adobe Systems Incorporated. All Rights Reserved. 1 Joe Berkovitz VP Engineering Allurent, Inc. Continuous Integration with Flex, FlexUnit, and Ant.
Parallel Processing (CS526) Spring 2012(Week 8).  Thread Status.  Synchronization in Shared Memory Programming(Java threads ) ◦ Locks ◦ Barriars.
Comparative Programming Languages hussein suleman uct csc304s 2003.
Coverage tools Program is typically compiled with special options, to add extra source or object code. –Additional data structures, such as a flow graph,
The HDF Group Multi-threading in HDF5: Paths Forward Current implementation - Future directions May 30-31, 2012HDF5 Workshop at PSI 1.
Buffered dynamic run-time profiling of arbitrary data for Virtual Machines which employ interpreter and Just-In-Time (JIT) compiler Compiler workshop ’08.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Java Software Solutions Lewis and Loftus Chapter 14 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Advanced Flow of Control --
July 2011CMSC 341 CVS/Ant 1 CMSC 341 Java Packages Ant CVS Project Submission.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Java development environment and Review of Java. Eclipse TM Intergrated Development Environment (IDE) Running Eclipse: Warning: Never check the “Use this.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
What is a cross compiler? A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the cross compiler.
14th Oct 2005CERN AB Controls Development Process of Accelerator Controls Software G.Kruk L.Mestre, V.Paris, S.Oglaza, V. Baggiolini, E.Roux and Application.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Concurrency & Dynamic Programming.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
Exceptions in C++. Exceptions  Exceptions provide a way to handle the errors generated by our programs by transferring control to functions called handlers.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Serialization Allows you to turn Java Objects into serial data that can be either save to a file or sent over a network. Usefull for persisting data.
Session 07 Module 13 - Collections. Collections / Session 7 / 2 of 32 Review  A delegate in C# is used to refer to a method in a safe manner.  To invoke.
1 Chapter 3: Loops and Logic. 2 Control Statements If statement Example NumberCheck.java Relational operators (, >=, ==, !=) Using code blocks with If.
Monitors CSCI 201L Jeffrey Miller, Ph.D. HTTP :// WWW - SCF. USC. EDU /~ CSCI 201 USC CSCI 201L.
Threads and Singleton. Threads  The JVM allows multiple “threads of execution”  Essentially separate programs running concurrently in one memory space.
The Java Assertion. 2 Assertion A Java statement in JDK 1.4 & newer Intent: enables code to test assumptions. E.g., a method that calculates the a particle’s.
Build Tools 1. Building a program for a large project is usually managed by a build tool that controls the various steps involved. These steps may include:
3/5/2002e-business and Information Systems1 Java Java Java Virtual Machine (JVM) Java Application Program Interface (API) HW Kernel API Application Programs.
(1) Code Walkthrough robocode-pmj-dacruzer Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
CSCI1600: Embedded and Real Time Software Lecture 17: Concurrent Programming Steven Reiss, Fall 2015.
HW7: Due Dec 5th 23:59 1.Describe test cases to reach full path coverage of the triangle program by completing the path condition table below. Also, draw.
Google C++ Testing Framework Part 2: Assertion. Concepts A test case contains one or many tests. ◦ You should group your tests into test cases that reflect.
© Dr. A. Williams, Fall Present Software Quality Assurance – Clover Lab 1 Tutorial / lab 2: Code instrumentation Goals of this session: 1.Create.
Starting Out With Java 5 Control Structures to Objects By Tony Gaddis Copyright © 2005 Pearson Addison- Wesley. All rights reserved. Chapter 1 Slide #1.
1© Copyright 2015 EMC Corporation. All rights reserved. NUMA(YEY) BY JACOB KUGLER.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
Java Primer 1: Types, Classes and Operators
Ant.
Code Coverage David Inglis November 18, 2018.
Multithreading.
Summary: steps for Project 0 submission
Thread Synchronization
What does this do? def revList(L): if len(L) < = 1: return L x = L[0] LR = revList(L[1:]) return LR + x.
Top Half / Bottom Half Processing
Programs and Classes A program is made up from classes
CSCI1600: Embedded and Real Time Software
Summary: steps for Project 0 submission
Lecture 8 Thread Safety.
COP 4600 Operating Systems Fall 2010
CSCI1600: Embedded and Real Time Software
Constructors and Deconstructor
HW#7 Describe test cases to reach full path coverage of the triangle program by completing the path condition table below. Also, draw the complete execution.
Threads and concurrency / Safety
Presentation transcript:

1HW13 Modify ThreadSafeBankAccount2 to use an assertion that checks a lock is released. Learn how to compile and run Java code with assertions. Define two Ant targets; one to run your program with an assertion enabled, and the other with the assertion disabled. (Either one can be the default target.) Due: Oct 11 (Thu) –Java file and build.xml –build.xml performs the default target, generates Java byte code and execute it.

2HW14 Modify DeadlockedBankAccount2.java to read “balance” with a read lock in if statements. Due 17 (Thu)

3HW15 AccessCounter –Maintains a map that pairs a file and access count. Use java.util.HashMap –increment() accepts a file path and increments the access count of the file –getCount() accepts a file path and returns the access count of the file. main() –runs multiple threads to call increment() and getCount() concurrently. java.util.HashMap is not thread safe. –Use read and write locks in HitCounter Due: April 18 (Thu)