Com S 541 Lecture -*- Outline -*- * The Data-Driven Concurrent Model (Ch 4) Based on Peter van Roy and Seif Haridi's book, "Concepts, Techniques, and Models of Computer Programming" (MIT Press, 2004), where all references that are not otherwise attributed are found. ** quiz ------------------------------------------ QUIZ FOR CHAPTER 4 [Motivation] Why is declarative concurrency useful? [model] What new features are added to the declarateive model to support concurrency? [usage] Why is the declarative concurrency model simple to use? [concepts] What is interleaving? What is the causal order? [causal order] What orders of steps follow the causal order? local A B in thread {Browse A} end thread {Browse B} end thread A=3 end thread B=A+2 end end [Observable nondeterminism] What is observable nondeterminism? [Semantics] What is a thread in the operational semantics? [exceptions] What happens when there is an unhandled exception in a thread? [Termination] What is partial termination? [Definition] What is the formal definition of declarative concurrency? [Failures] Are failures declarative? [Dataflow] How do dataflow variables help with programming with threads? [Streams] What is a stream? How would it be implemented? [Producer/Consumer programming] What ways are there to program with a producer-consumer architecture? What techniques are there for doing flow control in a stream-based system? How are these techniques programmed? [Bounded Buffer] How does a bounded buffer help with flow control? How is it implemented? [Architecture] Can streams only be used in pipelines? How do you fix deadlocks from feedback in a stream-based system? [Programming patterns] How do you let the language determine the order of calculations? Why are coroutines hard to use? How can one thread wait for another? How do you write barrier synchronization? [Lazy execution] What is lazy execution? Why is it useful? Is it independent of concurrency? [Model of lazy execution] What was needed in the formal model to have lazy execution? What is ByNeed's semantics like, if you ignore scheduling of when it runs? What is a need (what activates triggers)? [Lazy sugar] How is the lazy modifier on a function translated into ByNeed? [Lazy streams] What are the advantages to using lazy functions to program stream-based compuation vs. explictly programmed triggers? [Soft real time] What is soft real-time programming? What operations are useful for it? [NewTicker] Write NewTicker such that {NewTicker} returns a stream that grows by 1 element per second. [Haskell] What are the interesting features of Haskell? How does it differ from Oz? [Haskell types] What kinds of types does Haskell support? What is the notation for each type? What is a monomorphic type? What is a polymorphic type? Give an example of each [Type inference] How does type inference work? [Type classes] What is the difference between parametric and ad hoc polymorphism? How do type classes relate to object-oriented programming? How are they different? [Utility of the model] What are the advantages of declarative programming? Can we do everything efficiently with the declarative model? What can't be done efficiently? What problems are hard to modularize in the declarative model? Is the real world declarative? [Using several models] How can you use several computational models in the same program? [Exceptions] Is the declarative model with exceptions still declarative? What happens if the execution of a by-need trigger cannot complete normally? [Language Design] Should an imperative language be lazy by default? [Reduction order] What is normal order? How does it differ from applicative order reduction? [Dataflow variables] How is a dataflow variable like a communication channel? What are dataflow variables good for? ------------------------------------------