Programming Languages: Design, Specification, and Implementation G22.2210-001 Rob Strom November 9, 2006.

Slides:



Advertisements
Similar presentations
Type Systems and Object- Oriented Programming (III) John C. Mitchell Stanford University.
Advertisements

Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
Patterns in ML functions. Formal vs. actual parameters Here's a function definition (in C): –int add (int x, int y) { return x + y; } –x and y are the.
Background for “KISS: Keep It Simple and Sequential” cs264 Ras Bodik spring 2005.
Scope Chapter Ten Modern Programming Languages.
CSE 341, Winter Type Systems Terms to learn about types: –Type –Type system –Statically typed language –Dynamically typed language –Type error –Strongly.
Monitors Chapter 7. The semaphore is a low-level primitive because it is unstructured. If we were to build a large system using semaphores alone, the.
Programming Languages: Design, Specification, and Implementation G Rob Strom December 12, 2006.
Programming Languages: Design, Specification, and Implementation G Rob Strom November 16, 2006.
1 CS 312 – Lecture 28 Continuations –Probably the most confusing thing you’ve seen all semester… Course summary –Life after CS 312.
CSE 115 / 503 Introduction to Computer Science For Majors I Carl Alphonce 219 Bell Hall.
Principle 1 If more than one thread accesses a given state variable and one of them might write to it then All accesses to the variable must be correctly.
CS 312 Spring 2004 Lecture 18 Environment Model. Substitution Model Represents computation as doing substitutions for bound variables at reduction of.
Dr. Kivanc DincerCS319 Week 11 - Nov.21,20051 Chapter 20 Mapping Designs to Code Objectives Map design artifacts to code in an object-oriented language.
Principles of Object-Oriented Software Development The language Eiffel.
Programming Languages: Design, Specification, and Implementation G Rob Strom October 26, 2006.
Introduction to ML - Part 2 Kenny Zhu. What is next? ML has a rich set of structured values Tuples: (17, true, “stuff”) Records: {name = “george”, age.
Introduction to ML Last time: Basics: integers, Booleans, tuples,... simple functions introduction to data types This time, we continue writing an evaluator.
CS 312 Spring 2002 Lecture 16 The Environment Model.
COMS S1007 Object-Oriented Programming and Design in Java July 15, 2008.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
1 Sharing Objects – Ch. 3 Visibility What is the source of the issue? Volatile Dekker’s algorithm Publication and Escape Thread Confinement Immutability.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Programming Languages: Design, Specification, and Implementation G Rob Strom October 19, 2006.
System-Level Types for Component-Based Design Paper by: Edward A. Lee and Yuhong Xiong Presentation by: Dan Patterson.
Week 7 - Programming II Today – more features: – Loop control – Extending if/else – Nesting of loops Debugging tools Textbook chapter 7, pages
CS211: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Piazza – Textbook Highlight important.
Concurrency Recitation – 2/24 Nisarg Raval Slides by Prof. Landon Cox.
Software Engineering 1 The Life Cicle of Software Lesson 5.
Chapter TwelveModern Programming Languages1 Memory Locations For Variables.
1 Thread Synchronization: Too Much Milk. 2 Implementing Critical Sections in Software Hard The following example will demonstrate the difficulty of providing.
1 Thread II Slides courtesy of Dr. Nilanjan Banerjee.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 2 (19/01/2006) Instructor: Haifeng YU.
Accessing & Submitting Homework myitlab Microsoft Office Professional 1 CSP 1203.
Math 010 online work that is due today at the start of class: Gateway Homework #3 (turn in worksheet now, while I take roll) Section 1.2/1.8 Online Homework.
Please check, just in case…. Announcements: Office hour appointments filling up – get yours today! Don’t delay on getting started on next TWO assignments.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Documentation and Comments. What’s a comment? A comment is a simple form of documentation. Documentation is text that you the programmer write to explain.
10/16/2015IT 3271 All about binding n Variables are bound (dynamically) to values n values must be stored somewhere in the memory. Memory Locations for.
How to start Milestone 1 CSSE 371 Project Info There are only 8 easy steps…
Programming Languages: Design, Specification, and Implementation G Rob Strom November 30, 2006.
Formal Semantics Chapter Twenty-ThreeModern Programming Languages, 2nd ed.1.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Mutual Exclusion.
Internet Software Development Controlling Threads Paul J Krause.
1 Chapter 10 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
Games Development 2 Review & Revision Strategy CO3301 End of Semester 1.
Kernel Locking Techniques by Robert Love presented by Scott Price.
DOUBLE INSTANCE LOCKING A concurrency pattern with Lock-Free read operations Pedro Ramalhete Andreia Correia November 2013.
The ATOMOS Transactional Programming Language Mehdi Amirijoo Linköpings universitet.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
Error Example - 65/4; ! Toplevel input: ! 65/4; ! ^^ ! Type clash: expression of type ! int ! cannot have type ! real.
6.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts with Java – 8 th Edition Module 6: Process Synchronization.
TUESDAY, NOVEMBER 17 TH NO HOMEWORK TONIGHT  Good morning, class!.  Today’s Learning Targets: I can recall events from chapter 8 I can apply my understanding.
Concurrency (Threads) Threads allow you to do tasks in parallel. In an unthreaded program, you code is executed procedurally from start to finish. In a.
Multiplication Timed Tests.
Tutorial 2: Homework 1 and Project 1
A brief intro to: Parallelism, Threads, and Concurrency
Chapter 8 – Software Testing
Threads Cannot Be Implemented As a Library
Week 8 - Programming II Today – more features: Loop control
Chapter 10 Programming Fundamentals with JavaScript
Monitors Chapter 7.
Week of March th grade.
Monitors Chapter 7.
Monitors Chapter 7.
Userspace Synchronization
Process/Thread Synchronization (Part 2)
Product Training Program
Presentation transcript:

Programming Languages: Design, Specification, and Implementation G Rob Strom November 9, 2006

Other readings on ML

Readings (week 1) Theoretical and Historical Papers on Concurrency The “Readers/Writers” Problem Shared Registers (Part II) Wait-free synchronization Partially-ordered time. Concurrency models in object-oriented languages Ada Reference Manual Section 9 Java Reference Manual Chapter 17 Thinking in C++, chapter 11

Readings (week 2) Problems with the Memory Model Java Memory model is Broken Thread-Safe Programming Compiler-Enforced Thread-Safety (Guava): Safe Reader-Writer Parallelism (Optimistic Readers):

Programming Project on Concurrency – due Nov. 30 Extend the room world of the previous assignment so that multiple people can enter rooms and do things Each thing someone does is an atomic unit of work, e.g. Get things from factories and put them in the room Pick up a bunch of objects and put them in a container Pick up 2 containers and a funnel and transfer liquid from one container to the other Don’t deadlock Anticipate contention – e.g. you’ve picked up object A and try to pick up object B, but discover it’s gone because someone else picked up object B. You may need to give up your scripted action. The implementation should have the same realism properties as the non- concurrent implementation did: e.g. things shouldn’t spontaneously disappear or appear in multiple places. You may use any one of C++, Java, or Ada (probably the same language you used for previous assignment, but this is not required)

Notes on Grading of Projects The bulk of the points should go for understanding the assignment and correctly using the features of the languages being tested (e.g. in the polymorphism assignment, triggering run-time dispatching, and sharing a common interface). The next group of points is for clear documentation of the components, and what they do. The last group of points should be for correctness, freedom from bugs, conformity to test cases.

Homework: ML Type Inference Problem Type inference: fun zip f nil nil = nil | zip f (h::t) (i::s) = f(h,i)::zip f t s; What does it do? What is its most general type? Consider these two expressions (1) fun f g = g 7 + g false; (2) let val g = fn (x) => 20 in g 7 + g false; Why is (1) incorrectly typed and (2) correctly typed? What is the type of g in (2)?