JavaUI: Effects for Controlling UI Object Access.
In Proceedings of the 27th European Conference on Object-Oriented Programming (ECOOP'13), Montpellier, France. July 2013. To Appear.
Colin S. Gordon,
Werner M. Dietl,
Michael D. Ernst, and
Dan Grossman.
[+abstract]
[+bibtex]
[pdf | tech report]
[code]
Abstract:
Most graphical user interface (GUI) libraries forbid accessing
UI elements from threads other than the UI event loop thread. Violat-
ing this requirement leads to a program crash or an inconsistent UI.
Unfortunately, such errors are all too common in GUI programs.
We present the first type and effect system that prevents non-UI threads
from accessing UI objects or invoking UI-thread-only methods. The type
system still permits non-UI threads to hold and pass references to UI
objects. We implemented this type system for Java and annotated 8
Java programs (over 140KLOC) for the type system, including several of
the most popular Eclipse plugins. We confirmed bugs found by unsound
prior work, found an additional bug and code smells, and demonstrated
that the annotation burden is low.
We also describe code patterns our effect system handles less gracefully
or not at all, which we believe offers lessons for those applying other
effect systems to existing code.
@inproceedings{ecoop13,
title = {{JavaUI: Effects for Controlling UI Object Access}},
author = {{Gordon, Colin S. and Dietl, Werner and Ernst, Michael D. and Grossman, Dan}},
year = 2013,
booktitle = {{Proceedings of the 27th European Conference on Object-Oriented Programming (ECOOP'13)}},
address = {{Montpellier, France}},
month = {July},
note = "To Appear."
}
Rely-Guarantee References for Refinement Types over Aliased Mutable Data.
In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'13), Seattle, WA, USA. June 2013. To Appear.
Colin S. Gordon,
Michael D. Ernst, and
Dan Grossman.
[+abstract]
[+bibtex]
[pdf | tech report]
[code]
Abstract:
Reasoning about side effects and aliasing is the heart of verifying imperative programs. Unrestricted side effects through one reference can invalidate assumptions about an alias. We present a new
type system approach to reasoning about safe assumptions in the
presence of aliasing and side effects, unifying ideas from reference
immutability type systems and rely-guarantee program logics. Our
approach, rely-guarantee references, treats multiple references to
shared objects similarly to multiple threads in rely-guarantee program logics. We propose statically associating rely and guarantee
conditions with individual references to shared objects. Multiple
aliases to a given object may coexist only if the guarantee condition of each alias implies the rely condition for all other aliases. We
demonstrate that existing reference immutability type systems are
special cases of rely-guarantee references.
In addition to allowing precise control over state modification,
rely-guarantee references allow types to depend on mutable data
while still permitting flexible aliasing. Dependent types whose denotation is stable over the actions of the rely and guarantee conditions for a reference and its data will not be invalidated by any
action through any alias. We demonstrate this with refinement (subset) types that may depend on mutable data. As a special case, we
derive the first reference immutability type system with dependent
types over immutable data.
We show soundness for our approach, and describe experience using relyguarantee references in a dependently-typed monadic DSL in Coq.
@inproceedings{pldi13,
title = {{Rely-Guarantee References for Refinement Types Over Aliased Mutable Data}},
author = {Gordon, Colin S. and Ernst, Michael D. and Grossman, Dan},
year = 2013,
booktitle = {{Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI'13)}},
address = {{Seattle, WA, USA}},
month = {June},
note = "To Appear."
}
Uniqueness and Reference Immutability for Safe Parallelism.
In Proceedings of the 27th ACM SIGPLAN Conference on Object Oriented Programming Systems, Languages, and Applications (OOPSLA'12), Tucson, AZ, USA. October 2012.
Colin S. Gordon, Matthew
J. Parkinson, Jared Parsons, Aleks Bromfield, and Joe
Duffy.
Acceptance rate 26% (59/228).
[+abstract]
[+bibtex]
[acm | acm authorizer |
pdf | tech report | tech report @ msr ]
[slides]
[Press:
slashdot
| reddit
| hacker news
(most coverage misunderstood the work)]
Abstract:
A key challenge for concurrent programming is that side-effects (memory operations) in one thread
can affect the behavior of another thread.
In this paper, we present a type system to restrict the updates to memory to prevent these unintended side-effects.
We provide a novel combination of immutable and unique (isolated) types that ensures safe parallelism (race freedom and
deterministic execution).
The type system includes support for polymorphism over
type qualifiers, and can easily create cycles of immutable
objects. Key to the system's flexibility is the ability to recover
immutable or externally unique references after violating uniqueness
without any explicit alias tracking.
Our type system models a prototype extension to C\# that is in active use by a
Microsoft team. We describe their experiences building large systems with this extension.
We
prove the soundness of the type system by an embedding into a program logic.
@inproceedings{oopsla12,
title = {{Uniqueness and Reference Immutability for Safe Parallelism}},
author = {Gordon, Colin S. and Parkinson, Matthew J. and Parsons, Jared and Bromfield, Aleks and Duffy, Joe},
booktitle = {{Proceedings of the 2012 ACM International Conference on Object Oriented Programming,
Systems, Languages, and Applications (OOPSLA'12)}},
address = {{Tucson, AZ, USA}},
month = {October},
year = 2012,
}