Linguistic Symbiosis between Actors and Threads

Size: px
Start display at page:

Download "Linguistic Symbiosis between Actors and Threads"

Transcription

1 Linguistic Symbiosis between s and Threads Tom Van Cutsem Stijn Mostinckx Wolfgang De Meuter Programming Technology Lab Vrije Universiteit Brussel Brussels, Belgium International Conference on Dynamic Languages, August 27th 2007, Lugano

2 2 Overview AmbientTalk: OO DSL for mobile ad hoc networks Pure event-driven concurrency model (actors [Agha86]) How to do a safe linguistic symbiosis between actors and threads?

3 3 s vs. Threads actor: { def obj := object: { def m() {... } } def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) { obj.m(); } }) } obj.m();

4 3 s vs. Threads actor: { def obj := object: { def m() {... } } def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) { obj.m(); } }) } obj.m();

5 4 Event Loop Concurrency Events are executed serially Event notification is strictly asynchronous Event loops should have no shared state Event Event Queue Event Loop Event Handler

6 5 Event loop concurrency Based on E programming language [Miller05] Message queue Event loop

7 5 Event loop concurrency Based on E programming language [Miller05] local object Message queue Event loop

8 5 Event loop concurrency Based on E programming language [Miller05] local object obj.m() obj Message queue Event loop

9 5 Event loop concurrency Based on E programming language [Miller05] local object remote object Message queue Event loop

10 5 Event loop concurrency Based on E programming language [Miller05] local object remote object obj<-m() obj Message queue Event loop

11 5 Event loop concurrency Based on E programming language [Miller05] local object remote object obj<-m() obj Message queue Event loop s cannot cause deadlock No race conditions on objects

12 6 AmbientTalk/Java Based on Inter-language Reflection [Gybels et al 05] AmbientTalk is implemented in Java Data mapping: cfr. JRuby, Jython, JScheme, LuaJava, JPiccola,... Tight integration at the syntactic level def Button := jlobby.java.awt.button; def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } }); button.setvisible(true);

13 /Thread Mapping 7

14 7 /Thread Mapping?

15 8 s as Threads def obj := object: {... }; ajavacollection.add(obj); obj ajavacollection

16 8 s as Threads def obj := object: {... }; ajavacollection.add(obj); add(obj) obj ajavacollection

17 8 s as Threads def obj := object: {... }; ajavacollection.add(obj); add(obj) obj ajavacollection

18 8 s as Threads def obj := object: {... }; ajavacollection.add(obj); add(obj) obj synchronizedcol

19 9 s as Threads def obj := object: { def compareto(other) {... } } ajavacollection.add(obj); obj ajavacollection

20 9 s as Threads def obj := object: { def compareto(other) {... } } ajavacollection.add(obj); obj add(obj) ajavacollection

21 9 s as Threads def obj := object: { def compareto(other) {... } } ajavacollection.add(obj); obj add(obj) ajavacollection

22 9 s as Threads def obj := object: { def compareto(other) {... } } ajavacollection.add(obj); compareto(obj2) obj add(obj) ajavacollection

23 9 s as Threads def obj := object: { def compareto(other) {... } } ajavacollection.add(obj); obj add(obj) ajavacollection

24 10 Threads as s interface junit.framework.test { public int counttestcases(); public void run(testresult r); } def ambienttalktest := object: { def counttestcases() {... } def run(result) {... } }

25 10 Threads as s interface junit.framework.test { public int counttestcases(); public void run(testresult r); } def ambienttalktest := object: { def counttestcases() {... } def run(result) {... } } TestSuite suite = new TestSuite(); ATObject atunittest = /* load ambienttalk test */; suite.addtest((test) wrap(atunittest, Test.class)); suite.addtest(ajavaunittest); junit.textuit.testrunner.run(suite);

26 10 Threads as s ambienttalktest suite

27 10 Threads as s run(result) ambienttalktest suite

28 10 Threads as s run(result) ambienttalktest suite

29 10 Threads as s ambienttalktest suite

30 10 Threads as s ambienttalktest suite wrapper

31 10 Threads as s barrier.get() ambienttalktest suite wrapper

32 10 Threads as s barrier.get() ambienttalktest suite wrapper

33 10 Threads as s barrier.get() ambienttalktest suite wrapper

34 11 Threads as s ActionListener l =...; l.actionperformed(actionevent); def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } });

35 11 Threads as s ActionListener l =...; l.actionperformed(actionevent); def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } }); buttonlistener button

36 11 Threads as s ActionListener l =...; l.actionperformed(actionevent); def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } }); actionperformed(ae) buttonlistener button

37 11 Threads as s ActionListener l =...; l.actionperformed(actionevent); def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } }); buttonlistener button wrapper

38 11 Threads as s ActionListener l =...; l.actionperformed(actionevent); def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } }); buttonlistener button wrapper

39 11 Threads as s ActionListener l =...; l.actionperformed(actionevent); def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } }); buttonlistener button wrapper

40 11 Threads as s ActionListener l =...; l.actionperformed(actionevent); def button := Button.new( Click Me ); button.addactionlistener(object: { def actionperformed(actionevent) {... } }); buttonlistener button wrapper

41 11 Threads as s interface I extends java.util.eventlistener { public void event(...); } buttonlistener button wrapper

42 Summary 12

43 12 Summary collection.add(obj)

44 12 Summary obj.compareto(obj2)

45 Summary 12

46 12 Summary unittest.run(reporter)

47 12 Summary listener.actionperformed(ae)

48 13 Experience AmbientTalk using Java: AWT and Swing for GUI construction Java using AmbientTalk: JEdit plugin for collaborative text editing Self/Squeak s Morphic UI framework in AmbientTalk

49 14 Conclusions AmbientTalk: object-oriented (distributed) event-driven programming Symbiotic Thread/ mapping: AmbientTalk invocations proceed immediately Automatic synchronization of Java invocations Support for Java event notifications (listeners)

AmbientTalk: Object-oriented Event-driven programming in Mobile Ad hoc Networks

AmbientTalk: Object-oriented Event-driven programming in Mobile Ad hoc Networks AmbientTalk: Object-oriented Event-driven programming in Mobile Ad hoc Networks Tom Van Cutsem Stijn Mostinckx Elisa Gonzalez Boix Jessie Dedecker Wolfgang De Meuter Programming Technology Lab Vrije Universiteit

More information

AmbientTalk: Object-oriented Event-driven programming in Mobile Ad hoc Networks

AmbientTalk: Object-oriented Event-driven programming in Mobile Ad hoc Networks AmbientTalk: Object-oriented Event-driven programming in Mobile Ad hoc Networks Tom Van Cutsem Programming Technology Lab Vrije Universiteit Brussel Brussels, Belgium LAMP - EPFL, July 25th 2007, Lausanne

More information

Linguistic Symbiosis between Actors and Threads

Linguistic Symbiosis between Actors and Threads Linguistic Symbiosis between Actors and Threads Tom Van Cutsem, Stijn Mostinckx, and Wolfgang De Meuter {tvcutsem smostinc wdmeuter}@vub.ac.be Programming Technology Lab Vrije Universiteit Brussel Brussels

More information

Resilient Partitioning of Pervasive Computing Services

Resilient Partitioning of Pervasive Computing Services Resilient Partitioning of Pervasive Computing Services Engineer Bainomugisha Promotor: Prof. Dr. Wolfgang De Meuter Advisors: Jorge Vallejos Elisa Gonzalez Boix Programming Technology Lab Vrije Universiteit

More information

Ambient-Oriented Programming

Ambient-Oriented Programming Ambient-Oriented Programming Designing an Object-Oriented Language for Ambient Intelligence Dr. Éric Tanter University of Chile DCC/CWR etanter@dcc.uchile.cl Presented at the JCC 2005. (c) E. Tanter, All

More information

Parallel Actor Monitors

Parallel Actor Monitors Parallel Monitors Christophe Scholliers Vrije Universiteit Brussel Pleinlaan 2, Elsene, Belgium cfscholl@vub.ac.be Éric Tanter PLEIAD Laboratory DCC / University of Chile etanter@dcc.uchile.cl Wolfgang

More information

Event Loop Coordination Using Meta-programming

Event Loop Coordination Using Meta-programming Event Loop Coordination Using Meta-programming Laure Philips, Dries Harnie, Kevin Pinte, Wolfgang Meuter To cite this version: Laure Philips, Dries Harnie, Kevin Pinte, Wolfgang Meuter. Event Loop Coordination

More information

Shacl: Operational Semantics

Shacl: Operational Semantics Shacl: Operational Semantics Joeri De Koster, Tom Van Cutsem Vrije Universiteit Brussel, Pleinlaan 2, B-1050 Brussels, Belgium 1. Operational semantics In this section we describe the operational semantics

More information

Context-Aware Leasing for Mobile Ad hoc Networks

Context-Aware Leasing for Mobile Ad hoc Networks Context-Aware Leasing for Mobile Ad hoc Networks Elisa Gonzalez Boix, Jorge Vallejos, Tom Van Cutsem, Jessie Dedecker, and Wolfgang De Meuter Programming Technology Lab Vrije Universiteit Brussel, Belgium

More information

Towards a Domain-Specific Aspect Language for Leasing in Mobile Ad hoc Networks

Towards a Domain-Specific Aspect Language for Leasing in Mobile Ad hoc Networks Towards a Domain-Specific Aspect Language for Leasing in Mobile Ad hoc Networks Elisa Gonzalez Boix Thomas Cleenewerk Jessie Dedecker Wolfgang De Meuter Programming Technology Lab Vrije Universiteit Brussel

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 35 November 29, 2017 Swing II: Building GUIs Inner Classes Chapter 29 Announcements Game Project Complete Code Due: December 11 th NO LATE SUBMISSIONS

More information

Ambient Clouds: Reactive Asynchronous Collections for Mobile Ad Hoc Network Applications

Ambient Clouds: Reactive Asynchronous Collections for Mobile Ad Hoc Network Applications Ambient Clouds: Reactive Asynchronous Collections for Mobile Ad Hoc Network Applications Kevin Pinte, Andoni Lombide Carreton, Elisa Gonzalez Boix, and Wolfgang De Meuter Software Languages Lab, Vrije

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 35 November 28, 2018 Swing II: Inner Classes and Layout Chapter 30 Announcements Game Project Complete Code Due: December 10 th NO LATE SUBMISSIONS

More information

Writing Concurrent Desktop Applications in an Actor-Based Programming Model

Writing Concurrent Desktop Applications in an Actor-Based Programming Model Writing Concurrent Desktop Applications in an Actor-Based Programming Model Jan Schäfer Arnd Poetzsch-Heffter jschaefer@cs.uni-kl.de University of Kaiserslautern Department of Computer Science Software

More information

Problems with Concurrency. February 19, 2014

Problems with Concurrency. February 19, 2014 with Concurrency February 19, 2014 s with concurrency interleavings race conditions dead GUI source of s non-determinism deterministic execution model 2 / 30 General ideas Shared variable Access interleavings

More information

Scala Actors. Scalable Multithreading on the JVM. Philipp Haller. Ph.D. candidate Programming Methods Lab EPFL, Lausanne, Switzerland

Scala Actors. Scalable Multithreading on the JVM. Philipp Haller. Ph.D. candidate Programming Methods Lab EPFL, Lausanne, Switzerland Scala Actors Scalable Multithreading on the JVM Philipp Haller Ph.D. candidate Programming Methods Lab EPFL, Lausanne, Switzerland The free lunch is over! Software is concurrent Interactive applications

More information

Problems with Concurrency

Problems with Concurrency with Concurrency February 14, 2012 1 / 27 s with concurrency race conditions deadlocks GUI source of s non-determinism deterministic execution model interleavings 2 / 27 General ideas Shared variable Shared

More information

A Prototype-based Approach to Distributed Applications

A Prototype-based Approach to Distributed Applications A Prototype-based Approach to Distributed Applications Tom Van Cutsem Stijn Mostincx Promotor: Prof. Dr. Theo D Hondt Advisors: Wolfgang De Meuter and Jessie Dedecker December 11, 2004 A Prototype-based

More information

Benefits of Concurrency in Java & Android: Program Structure

Benefits of Concurrency in Java & Android: Program Structure Benefits of Concurrency in Java & Android: Program Structure Douglas C. Schmidt d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Institute for Software Integrated Systems Vanderbilt University

More information

Introduction to concurrency and GUIs

Introduction to concurrency and GUIs Principles of Software Construction: Objects, Design, and Concurrency Part 2: Designing (Sub)systems Introduction to concurrency and GUIs Charlie Garrod Bogdan Vasilescu School of Computer Science 1 Administrivia

More information

Lab. Lecture 26: Concurrency & Responsiveness. Assignment. Maze Program

Lab. Lecture 26: Concurrency & Responsiveness. Assignment. Maze Program Lab Lecture 26: Concurrency & Responsiveness CS 62 Fall 2016 Kim Bruce & Peter Mawhorter Using parallelism to speed up sorting using Threads and ForkJoinFramework Review relevant material. Some slides

More information

Cheng, CSE870. More Frameworks. Overview. Recap on OOP. Acknowledgements:

Cheng, CSE870. More Frameworks. Overview. Recap on OOP. Acknowledgements: More Frameworks Acknowledgements: K. Stirewalt. Johnson, B. Foote Johnson, Fayad, Schmidt Overview eview of object-oriented programming (OOP) principles. Intro to OO frameworks: o Key characteristics.

More information

Efficient Composition Styles

Efficient Composition Styles Efficient Composition Styles Franz Achermann, Nathanael Schärli Software Composition Group University of Berne www.iam.unibe.ch/~ scg Software Composition Group Slide 1 of 15 Overview Introduction What

More information

Inter-language reflection: A conceptual model and its implementation

Inter-language reflection: A conceptual model and its implementation Computer Languages, Systems & Structures 32 (2006) 109 124 www.elsevier.com/locate/cl Inter-language reflection: A conceptual model and its implementation Kris Gybels a,, Roel Wuyts b, Stéphane Ducasse

More information

Graphical User Interface (Part-1) Supplementary Material for CPSC 233

Graphical User Interface (Part-1) Supplementary Material for CPSC 233 Graphical User Interface (Part-1) Supplementary Material for CPSC 233 Introduction to Swing A GUI (graphical user interface) is a windowing system that interacts with the user The Java AWT (Abstract Window

More information

[module lab 2.2] GUI FRAMEWORKS & CONCURRENCY

[module lab 2.2] GUI FRAMEWORKS & CONCURRENCY v1.0 BETA Sistemi Concorrenti e di Rete LS II Facoltà di Ingegneria - Cesena a.a 2008/2009 [module lab 2.2] GUI FRAMEWORKS & CONCURRENCY 1 GUI FRAMEWORKS & CONCURRENCY Once upon a time GUI applications

More information

CSC207 Week 4. Larry Zhang

CSC207 Week 4. Larry Zhang CSC207 Week 4 Larry Zhang 1 Logistics A1 Part 1, read Arnold s emails. Follow the submission schedule. Read the Q&A session in the handout. Ask questions on the discussion board. Submit on time! Don t

More information

Taming Dava Threads. Apress ALLEN HOLUB. HLuHB Darmstadt

Taming Dava Threads. Apress ALLEN HOLUB. HLuHB Darmstadt Taming Dava Threads ALLEN HOLUB HLuHB Darmstadt Apress TM Chapter l The Architecture of Threads l The Problems with Threads l All Nontrivial Java Programs Are Multithreaded 2 Java's Thread Support Is Not

More information

Distributed Collaboration - Assignment 1: Multi-View 1-User IM

Distributed Collaboration - Assignment 1: Multi-View 1-User IM Distributed Collaboration - Assignment 1: Multi-View 1-User IM Date Assigned:??? 1-View Target Date:??? Multi-View Submission Date:??? Objectives: Understand the use of observer pattern in user -interface

More information

Object-oriented Reactive Programming is Not Reactive Object-oriented Programming

Object-oriented Reactive Programming is Not Reactive Object-oriented Programming Object-oriented Reactive Programming is Not Reactive Object-oriented Programming Elisa Gonzalez Boix egonzale@vub.ac.be Kevin Pinte kpinte@vub.ac.be Wolfgang De Meuter wdmeuter@vub.ac.be Simon Van de Water

More information

A Hybrid Visual Dataflow Language for Coordination in Mobile Ad Hoc Networks

A Hybrid Visual Dataflow Language for Coordination in Mobile Ad Hoc Networks A Hybrid Visual Dataflow Language for Coordination in Mobile Ad Hoc Networks Andoni Lombide Carreton and Theo D Hondt Software Languages Lab Vrije Universiteit Brussel, Pleinlaan 2 1050 Brussel, Belgium

More information

Graphic User Interfaces. - GUI concepts - Swing - AWT

Graphic User Interfaces. - GUI concepts - Swing - AWT Graphic User Interfaces - GUI concepts - Swing - AWT 1 What is GUI Graphic User Interfaces are used in programs to communicate more efficiently with computer users MacOS MS Windows X Windows etc 2 Considerations

More information

Parallel Actor Monitors: Disentangling Task-Level Parallelism from Data Partitioning in the Actor Model.

Parallel Actor Monitors: Disentangling Task-Level Parallelism from Data Partitioning in the Actor Model. Parallel Actor Monitors: Disentangling Task-Level Parallelism from Data Partitioning in the Actor Model. Christophe Scholliers a,1,, Éric Tanter b,2, Wolfgang De Meuter a a Software Languages Lab, Vrije

More information

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM)

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM) DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR 2018-19 (ODD SEM) DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SUB: OBJECT ORIENTED PROGRAMMING SEM/YEAR: III SEM/ II YEAR

More information

Graphical User Interfaces (GUIs)

Graphical User Interfaces (GUIs) CMSC 132: Object-Oriented Programming II Graphical User Interfaces (GUIs) Department of Computer Science University of Maryland, College Park Model-View-Controller (MVC) Model for GUI programming (Xerox

More information

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE

More information

(Incomplete) History of GUIs

(Incomplete) History of GUIs CMSC 433 Programming Language Technologies and Paradigms Spring 2004 Graphical User Interfaces April 20, 2004 (Incomplete) History of GUIs 1973: Xerox Alto 3-button mouse, bit-mapped display, windows 1981:

More information

Java Concurrency in practice Chapter 9 GUI Applications

Java Concurrency in practice Chapter 9 GUI Applications Java Concurrency in practice Chapter 9 GUI Applications INF329 Spring 2007 Presented by Stian and Eirik 1 Chapter 9 GUI Applications GUI applications have their own peculiar threading issues To maintain

More information

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java. [Course Overview] The Core Java technologies and application programming interfaces (APIs) are the foundation of the Java Platform, Standard Edition (Java SE). They are used in all classes of Java programming,

More information

Implementing Joins using Extensible Pattern Matching

Implementing Joins using Extensible Pattern Matching Implementing Joins using Extensible Pattern Matching Philipp Haller, EPFL joint work with Tom Van Cutsem, Vrije Universiteit Brussel Introduction Concurrency is indispensable: multi-cores, asynchronous,

More information

Lecture 19 GUI Events

Lecture 19 GUI Events CSE 331 Software Design and Implementation Lecture 19 GUI Events The plan User events and callbacks Event objects Event listeners Registering listeners to handle events Anonymous inner classes Proper interaction

More information

CSE 331 Software Design & Implementation

CSE 331 Software Design & Implementation CSE 331 Software Design & Implementation Hal Perkins Spring 2017 GUI Event-Driven Programming 1 The plan User events and callbacks Event objects Event listeners Registering listeners to handle events Anonymous

More information

Grand Central Dispatch and NSOperation. CSCI 5828: Foundations of Software Engineering Lecture 28 12/03/2015

Grand Central Dispatch and NSOperation. CSCI 5828: Foundations of Software Engineering Lecture 28 12/03/2015 Grand Central Dispatch and NSOperation CSCI 5828: Foundations of Software Engineering Lecture 28 12/03/2015 1 Credit Where Credit Is Due Most of the examples in this lecture were inspired by example code

More information

Interface Implementation

Interface Implementation Interface Implementation HCI Lecture 11 David Aspinall Informatics, University of Edinburgh 26th October 2007 Outline Overview Software Engineering Usability Engineering Explaining Design Implementation

More information

G51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread

G51PGP Programming Paradigms. Lecture 008 Inner classes, anonymous classes, Swing worker thread G51PGP Programming Paradigms Lecture 008 Inner classes, anonymous classes, Swing worker thread 1 Reminder subtype polymorphism public class TestAnimals public static void main(string[] args) Animal[] animals

More information

Concurrency. Unleash your processor(s) Václav Pech

Concurrency. Unleash your processor(s) Václav Pech Concurrency Unleash your processor(s) Václav Pech About me Passionate programmer Concurrency enthusiast GPars @ Codehaus lead Groovy contributor Technology evangelist @ JetBrains http://www.jroller.com/vaclav

More information

Heavyweight with platform-specific widgets. AWT applications were limited to commonfunctionality that existed on all platforms.

Heavyweight with platform-specific widgets. AWT applications were limited to commonfunctionality that existed on all platforms. Java GUI Windows Events Drawing 1 Java GUI Toolkits Toolkit AWT Description Heavyweight with platform-specific widgets. AWT applications were limited to commonfunctionality that existed on all platforms.

More information

Handouts. 1 Handout for today! Recap. Homework #2 feedback. Last Time. What did you think? HW3a: ThreadBank. Today. Small assignment.

Handouts. 1 Handout for today! Recap. Homework #2 feedback. Last Time. What did you think? HW3a: ThreadBank. Today. Small assignment. Handouts CS193J: Programming in Java Summer Quarter 2003 Lecture 10 Thread Interruption, Cooperation (wait/notify), Swing Thread, Threading conclusions 1 Handout for today! #21: Threading 3 #22: HW3a:

More information

Orchestrating Nomadic Mashups using Workflows

Orchestrating Nomadic Mashups using Workflows Orchestrating Nomadic Mashups using Workflows Niels Joncheere njonchee@vub.ac.be Eline Philips ephilips@vub.ac.be Wolfgang De Meuter wdmeuter@vub.ac.be Andoni Lombide Carreton alombide@vub.ac.be Software

More information

CONTENTS. Chapter 1 Getting Started with Java SE 6 1. Chapter 2 Exploring Variables, Data Types, Operators and Arrays 13

CONTENTS. Chapter 1 Getting Started with Java SE 6 1. Chapter 2 Exploring Variables, Data Types, Operators and Arrays 13 CONTENTS Chapter 1 Getting Started with Java SE 6 1 Introduction of Java SE 6... 3 Desktop Improvements... 3 Core Improvements... 4 Getting and Installing Java... 5 A Simple Java Program... 10 Compiling

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 34 April 11, 2016 Swing II: Inner Classes and Layout Announcements (Review) Final exam: May 2, 3-5PM If you have two finals at the same time, you can

More information

CS108, Stanford Handout #22. Thread 3 GUI

CS108, Stanford Handout #22. Thread 3 GUI CS108, Stanford Handout #22 Winter, 2006-07 Nick Parlante Thread 3 GUI GUIs and Threading Problem: Swing vs. Threads How to integrate the Swing/GUI/drawing system with threads? Problem: The GUI system

More information

CSE 331 Software Design and Implementation. Lecture 19 GUI Events

CSE 331 Software Design and Implementation. Lecture 19 GUI Events CSE 331 Software Design and Implementation Lecture 19 GUI Events Leah Perlmutter / Summer 2018 Announcements Announcements Quiz 7 due Thursday 8/9 Homework 8 due Thursday 8/9 HW8 has a regression testing

More information

CS11 Java. Fall Lecture 4

CS11 Java. Fall Lecture 4 CS11 Java Fall 2006-2007 Lecture 4 Today s Topics Interfaces The Swing API Event Handlers Inner Classes Arrays Java Interfaces Classes can only have one parent class No multiple inheritance in Java! By

More information

Domains: Sharing State in the Communicating Event-Loop Actor Model

Domains: Sharing State in the Communicating Event-Loop Actor Model Domains: Sharing State in the Communicating Event-Loop Actor Model Joeri De Koster, Stefan Marr, Tom Van Cutsem, Theo D Hondt To cite this version: Joeri De Koster, Stefan Marr, Tom Van Cutsem, Theo D

More information

The Actor Model. Towards Better Concurrency. By: Dror Bereznitsky

The Actor Model. Towards Better Concurrency. By: Dror Bereznitsky The Actor Model Towards Better Concurrency By: Dror Bereznitsky 1 Warning: Code Examples 2 Agenda Agenda The end of Moore law? Shared state concurrency Message passing concurrency Actors on the JVM More

More information

When the Servlet Model Doesn't Serve. Gary Murphy Hilbert Computing, Inc.

When the Servlet Model Doesn't Serve. Gary Murphy Hilbert Computing, Inc. When the Servlet Model Doesn't Serve Gary Murphy Hilbert Computing, Inc. glm@hilbertinc.com Motivation? Many decision makers and programmers equate Java with servlets? Servlets are appropriate for a class

More information

AmbientTalk: programming responsive mobile peer-to-peer applications with actors

AmbientTalk: programming responsive mobile peer-to-peer applications with actors AmbientTalk: programming responsive mobile peer-to-peer applications with actors Tom Van Cutsem a,1,, Elisa Gonzalez Boix a,2, Christophe Scholliers a,3, Andoni Lombide Carreton a, Dries Harnie a,2, Kevin

More information

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class CHAPTER GRAPHICAL USER INTERFACES 10 Slides by Donald W. Smith TechNeTrain.com Final Draft 10/30/11 10.1 Frame Windows Java provides classes to create graphical applications that can run on any major graphical

More information

Concurrency Abstractions in C#

Concurrency Abstractions in C# Concurrency Abstractions in C# Concurrency critical factor in behavior/performance affects semantics of all other constructs advantages of language vs. library compiler analysis/optimization clarity of

More information

Concurrency Abstractions in C#

Concurrency Abstractions in C# Concurrency Abstractions in C# Concurrency critical factor in behavior/performance affects semantics of all other constructs advantages of language vs. library compiler analysis/optimization clarity of

More information

The Observer Pattern

The Observer Pattern COP 4814 Florida International University Kip Irvine The Observer Pattern Updated: 2/25/2012 Based on Head-First Design Patterns, Chapter 2 Overview Why observers are necessary Who generates and observes

More information

Object-oriented Coordination in Mobile Ad hoc Networks

Object-oriented Coordination in Mobile Ad hoc Networks Object-oriented Coordination in Mobile Ad hoc Networks Tom Van Cutsem, Jessie Dedecker, and Wolfgang De Meuter tvcutsem jededeck wdmeuter@vub.ac.be Programming Technology Lab Vrije Universiteit Brussel

More information

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes Java CORE JAVA Core Java Programing (Course Duration: 40 Hours) Introduction to Java What is Java? Why should we use Java? Java Platform Architecture Java Virtual Machine Java Runtime Environment A Simple

More information

Real-Time and Concurrent Programming Lecture 4 (F4): Monitors: synchronized, wait and notify

Real-Time and Concurrent Programming Lecture 4 (F4): Monitors: synchronized, wait and notify http://cs.lth.se/eda040 Real-Time and Concurrent Programming Lecture 4 (F4): Monitors: synchronized, wait and notify Klas Nilsson 2016-09-20 http://cs.lth.se/eda040 F4: Monitors: synchronized, wait and

More information

JAVA CONCURRENCY FRAMEWORK. Kaushik Kanetkar

JAVA CONCURRENCY FRAMEWORK. Kaushik Kanetkar JAVA CONCURRENCY FRAMEWORK Kaushik Kanetkar Old days One CPU, executing one single program at a time No overlap of work/processes Lots of slack time CPU not completely utilized What is Concurrency Concurrency

More information

EPITA Première Année Cycle Ingénieur. Atelier Java - J5

EPITA Première Année Cycle Ingénieur. Atelier Java - J5 EPITA Première Année Cycle Ingénieur marwan.burelle@lse.epita.fr http://www.lse.epita.fr Overview 1 2 Different toolkits AWT: the good-old one, lakes some features and has a plateform specific look n

More information

Sharing is the Key. Lecture 25: Parallelism. Canonical Example. Bad Interleavings. Common to have: CS 62 Fall 2016 Kim Bruce & Peter Mawhorter

Sharing is the Key. Lecture 25: Parallelism. Canonical Example. Bad Interleavings. Common to have: CS 62 Fall 2016 Kim Bruce & Peter Mawhorter Sharing is the Key Lecture 25: Parallelism CS 62 Fall 2016 Kim Bruce & Peter Mawhorter Some slides based on those from Dan Grossman, U. of Washington Common to have: Different threads access the same resources

More information

Advantages of concurrent programs. Concurrent Programming Actors, SALSA, Coordination Abstractions. Overview of concurrent programming

Advantages of concurrent programs. Concurrent Programming Actors, SALSA, Coordination Abstractions. Overview of concurrent programming Concurrent Programming Actors, SALSA, Coordination Abstractions Carlos Varela RPI November 2, 2006 C. Varela 1 Advantages of concurrent programs Reactive programming User can interact with applications

More information

Mirror-based Reflection in AmbientTalk

Mirror-based Reflection in AmbientTalk SOFTWARE PRACTICE AND EXPERIENCE Softw. Pract. Exper. 2008; 0:01 37 [Version: 2002/09/23 v2.2] Mirror-based Reflection in AmbientTalk Stijn Mostinckx 1, Tom Van Cutsem 1, Stijn Timbermont 1, Elisa Gonzalez

More information

Concurrency Abstractions in C#

Concurrency Abstractions in C# Concurrency Abstractions in C# 1 1 Motivation Concurrency in C# Concurrency critical factor in behavior/performance affects semantics of all other constructs advantages of language vs. library Compiler

More information

CS Programming Languages: Scala

CS Programming Languages: Scala CS 3101-2 - Programming Languages: Scala Lecture 6: Actors and Concurrency Daniel Bauer (bauer@cs.columbia.edu) December 3, 2014 Daniel Bauer CS3101-2 Scala - 06 - Actors and Concurrency 1/19 1 Actors

More information

Design Patterns. it s about the Observer pattern, the Command pattern, MVC, and some GUI. some more

Design Patterns. it s about the Observer pattern, the Command pattern, MVC, and some GUI. some more Lecture: Software Engineering, Winter Semester 2011/2012 some more Design Patterns it s about the Observer pattern, the Command pattern, MVC, and some GUI Design Pattern *...+ describes a problem which

More information

COP 3330: Object Oriented Programming

COP 3330: Object Oriented Programming COP 3330: Object Oriented Programming SPRING 2017 STUDY UNION REVIEW SUNDAY, APRIL 23 RD CREDIT TO DR. GLINOS AND PROFESSOR WHITING FOR COURSE CONTENT Object-Oriented Structure Program Structure Main structural

More information

Recap. Contents. Reenterancy of synchronized. Explicit Locks: ReentrantLock. Reenterancy of synchronise (ctd) Advanced Thread programming.

Recap. Contents. Reenterancy of synchronized. Explicit Locks: ReentrantLock. Reenterancy of synchronise (ctd) Advanced Thread programming. Lecture 07: Advanced Thread programming Software System Components 2 Behzad Bordbar School of Computer Science, University of Birmingham, UK Recap How to deal with race condition in Java Using synchronised

More information

Concurrency Analysis of Asynchronous APIs

Concurrency Analysis of Asynchronous APIs Concurrency Analysis of Asynchronous APIs Anirudh Santhiar and Aditya Kanade April 2, 2016 Computer Science and Automation, IISc Introduction Asynchronous Programming Model1 A way to organize programs

More information

Review sheet for Final Exam (List of objectives for this course)

Review sheet for Final Exam (List of objectives for this course) Review sheet for Final Exam (List of objectives for this course) Please be sure to see other review sheets for this semester Please be sure to review tests from this semester Week 1 Introduction Chapter

More information

Java Programming. Price $ (inc GST)

Java Programming. Price $ (inc GST) 1800 ULEARN (853 276) www.ddls.com.au Java Programming Length 5 days Price $4235.00 (inc GST) Overview Intensive and hands-on, the course emphasizes becoming productive quickly as a Java application developer.

More information

TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill

TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill TYPES OF INTERACTORS Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill dewan@cs.unc.edu Code available at: https://github.com/pdewan/colabteaching PRE-REQUISITES Model-

More information

Pervasive Communication: The Need for Distributed Context Adaptations

Pervasive Communication: The Need for Distributed Context Adaptations Pervasive Communication: The Need for Distributed Context Adaptations Jorge Vallejos, Brecht Desmet, Pascal Costanza, Wolfgang De Meuter Programming Technology Lab Vrije Universiteit Brussel Pleinlaan

More information

JDirectoryChooser Documentation

JDirectoryChooser Documentation JDirectoryChooser Documentation Page 1 of 7 How to Use JDirectoryChooser The JDirectoryChooser provides user-friendly GUI for manipulating directories from Java application. User can either simply choose

More information

Virtual Machine Design

Virtual Machine Design Virtual Machine Design Lecture 4: Multithreading and Synchronization Antero Taivalsaari September 2003 Session #2026: J2MEPlatform, Connected Limited Device Configuration (CLDC) Lecture Goals Give an overview

More information

RE-ENTRANCY IN OPERATING SYSTEM. - By Surya Seetharaman

RE-ENTRANCY IN OPERATING SYSTEM. - By Surya Seetharaman RE-ENTRANCY IN OPERATING SYSTEM - By Surya Seetharaman What is Re-entrant code?? A computer program is called re-entrant, if it can be interrupted in the middle of its execution by another actor before

More information

Dynamic Languages and Applications

Dynamic Languages and Applications Dynamic Languages and Applications Report on the Workshop Dyla 07 at ECOOP 2007 Alexandre Bergel 1, Wolfgang De Meuter 2,Stéphane Ducasse 3, Oscar Nierstrasz 4,andRoelWuyts 5 1 Hasso-Plattner-Institut,

More information

Message Passing. Advanced Operating Systems Tutorial 7

Message Passing. Advanced Operating Systems Tutorial 7 Message Passing Advanced Operating Systems Tutorial 7 Tutorial Outline Review of Lectured Material Discussion: Erlang and message passing 2 Review of Lectured Material Message passing systems Limitations

More information

An Overview of Scala. Philipp Haller, EPFL. (Lots of things taken from Martin Odersky's Scala talks)

An Overview of Scala. Philipp Haller, EPFL. (Lots of things taken from Martin Odersky's Scala talks) An Overview of Scala Philipp Haller, EPFL (Lots of things taken from Martin Odersky's Scala talks) The Scala Programming Language Unifies functional and object-oriented programming concepts Enables embedding

More information

Java Threads. COMP 585 Noteset #2 1

Java Threads. COMP 585 Noteset #2 1 Java Threads The topic of threads overlaps the boundary between software development and operation systems. Words like process, task, and thread may mean different things depending on the author and the

More information

Executive Summary. It is important for a Java Programmer to understand the power and limitations of concurrent programming in Java using threads.

Executive Summary. It is important for a Java Programmer to understand the power and limitations of concurrent programming in Java using threads. Executive Summary. It is important for a Java Programmer to understand the power and limitations of concurrent programming in Java using threads. Poor co-ordination that exists in threads on JVM is bottleneck

More information

Bringing Scheme Programming to the iphone Experience

Bringing Scheme Programming to the iphone Experience SOFTWARE PRACTICE AND EXPERIENCE Softw. Pract. Exper. 2000; 00:1 7 [Version: 2002/09/23 v2.2] Bringing Scheme Programming to the iphone Experience Engineer Bainomugisha, Jorge Vallejos, Elisa Gonzalez

More information

implementation support

implementation support Implementation support chapter 8 implementation support programming tools levels of services for programmers windowing systems core support for separate and simultaneous usersystem activity programming

More information

CS193j, Stanford Handout #21. Threading 3

CS193j, Stanford Handout #21. Threading 3 CS193j, Stanford Handout #21 Summer, 2003 Manu Kumar Threading 3 Thread Challenge #2 -- wait/ Co-ordination Synchronization is the first order problem with concurrency. The second problem is coordination

More information

Last class: Today: Thread Background. Thread Systems

Last class: Today: Thread Background. Thread Systems 1 Last class: Thread Background Today: Thread Systems 2 Threading Systems 3 What kind of problems would you solve with threads? Imagine you are building a web server You could allocate a pool of threads,

More information

Merge Sort Quicksort 9 Abstract Windowing Toolkit & Swing Abstract Windowing Toolkit (AWT) vs. Swing AWT GUI Components Layout Managers Swing GUI

Merge Sort Quicksort 9 Abstract Windowing Toolkit & Swing Abstract Windowing Toolkit (AWT) vs. Swing AWT GUI Components Layout Managers Swing GUI COURSE TITLE :Introduction to Programming 2 COURSE PREREQUISITE :Introduction to Programming 1 COURSE DURATION :16 weeks (3 hours/week) COURSE METHODOLOGY:Combination of lecture and laboratory exercises

More information

Intro to POSIX Threads with FLTK

Intro to POSIX Threads with FLTK Intro to POSIX Threads with FLTK 25 Mar 2009 CMPT166 Dr. Sean Ho Trinity Western University See: FlChat/ example code Threads and parallelism Threads are lightweight processes Threads allow concurrency

More information

Distributed Object-Oriented Programming with RFID Technology

Distributed Object-Oriented Programming with RFID Technology Distributed Object-Oriented Programming with RFID Technology Andoni Lombide Carreton, Kevin Pinte, and Wolfgang De Meuter Software Languages Lab, Vrije Universiteit Brussel, Pleinlaan 2, 1050 Brussels,

More information

Need for synchronization: If threads comprise parts of our software systems, then they must communicate.

Need for synchronization: If threads comprise parts of our software systems, then they must communicate. Thread communication and synchronization There are two main aspects to Outline for Lecture 19 multithreaded programming in Java: I. Thread synchronization. thread lifecycle, and thread synchronization.

More information

CSE 331 Software Design & Implementation

CSE 331 Software Design & Implementation CSE 331 Software Design & Implementation Kevin Zatloukal Summer 2017 Java Graphics and GUIs (Based on slides by Mike Ernst, Dan Grossman, David Notkin, Hal Perkins, Zach Tatlock) Review: how to create

More information

Programming Language Concepts: Lecture 8

Programming Language Concepts: Lecture 8 Programming Language Concepts: Lecture 8 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 8, 11 February 2009 GUIs and event

More information

Parallel Code Smells: A Top 10 List

Parallel Code Smells: A Top 10 List Parallel Code Smells: A Top 10 List Luc Bläser Hochschule für Technik Rapperswil Multicore@Siemens 8 Feb. 2017, Nuremberg Code Smells Symptoms in code Indicators of potential design flaws Partly curable

More information

Java Event Handling -- 1

Java Event Handling -- 1 Java Event Handling -- 1 Event Handling Happens every time a user interacts with a user interface. For example, when a user pushes a button, or types a character. 2 A Typical Situation: Scrollbar AWTEvent

More information