16 research outputs found
Lock Inference for Java
Atomicity is an important property for concurrent software, as it provides a stronger guarantee
against errors caused by unanticipated thread interactions than race-freedom does. However,
concurrency control in general is tricky to get right because current techniques are too low-level
and error-prone. With the introduction of multicore processors, the problems are compounded.
Consequently, a new software abstraction is gaining popularity to take care of concurrency
control and the enforcing of atomicity properties, called atomic sections.
One possible implementation of their semantics is to acquire a global lock upon entry to each
atomic section, ensuring that they execute in mutual exclusion. However, this cripples concurrency,
as non-interfering atomic sections cannot run in parallel. Transactional memory is
another automated technique for providing atomicity, but relies on the ability to rollback conflicting atomic sections and thus places restrictions on the use of irreversible operations, such as
I/O and system calls, or serialises all sections that use such features. Therefore, from a language
designer's point of view, the challenge is to implement atomic sections without compromising
performance or expressivity.
This thesis explores the technique of lock inference, which infers a set of locks for each atomic
section, while attempting to balance the requirements of maximal concurrency, minimal locking
overhead and freedom from deadlock. We focus on lock-inference techniques for tackling large
Java programs that make use of mature libraries. This improves upon existing work, which
either (i) ignores libraries, (ii) requires library implementors to annotate which locks to take, or
(iii) only considers accesses performed up to one-level deep in library call chains. As a result,
each of these prior approaches may result in atomicity violations. This is a problem because
even simple uses of I/O in Java programs can involve large amounts of library code. Our
approach is the first to analyse library methods in full and thus able to soundly handle atomic
sections involving complicated real-world side effects, while still permitting atomic sections to
run concurrently in cases where their lock sets are disjoint.
To validate our claims, we have implemented our techniques in Lockguard, a fully automatic
tool that translates Java bytecode containing atomic sections to an equivalent program that
uses locks instead. We show that our techniques scale well and despite protecting all library
accesses, we obtain performance comparable to the original locking policy of our benchmarks
Recommended from our members
CHERI Concentrate: Practical Compressed Capabilities
We present CHERI Concentrate, a new fat-pointer compression scheme applied to CHERI, the most developed capability-pointer system at present. Capability fat-pointers are a primary candidate for enforcing fine-grained and non-bypassable security properties in future computer systems, although increased pointer size can severely affect performance. Thus, several proposals for capability compression have been suggested but these did not support legacy instruction sets, ignored features critical to the existing software base, and also introduced design inefficiencies to RISC-style processor pipelines. CHERI Concentrate improves on the state-of-the-art region-encoding efficiency, solves important pipeline problems, and eases semantic restrictions of compressed encoding, allowing it to protect a full legacy software stack. We analyze and extend logic from the open-source CHERI prototype processor design on FPGA to demonstrate encoding efficiency, minimize delay of pointer arithmetic, and eliminate additional load-to-use delay. To verify correctness of our proposed high-performance logic, we present a HOL4 machine-checked proof of the decode and pointer-modify operations. Finally, we measure a 50%-75% reduction in L2 misses for many compiled C-language benchmarks running under a commodity operating system using compressed 128-bit and 64-bit formats, demonstrating both compatibility with and increased performance over the uncompressed, 256-bit format
Recommended from our members
CHERI JNI: Sinking the Java Security Model into the C
Java provides security and robustness by building a high- level security model atop the foundation of memory protection. Unfortunately, any native code linked into a Java program – including the million lines used to implement the standard library – is able to bypass both the memory protection and the higher-level policies. We present a hardware-assisted implementation of the Java native code interface, which extends the guarantees required for Java’s security model to native code.
Our design supports safe direct access to buffers owned by the JVM, including hardware-enforced read-only access where appropriate. We also present Java language syntax to declaratively describe isolated compartments for native code.
We show that it is possible to preserve the memory safety and isolation requirements of the Java security model in C code, allowing native code to run in the same process as Java code with the same impact on security as running equivalent Java code. Our approach has a negligible impact on performance, compared with the existing unsafe native code interface. We demonstrate a prototype implementation running on the CHERI microprocessor synthesized in FPGA.Defense Advanced Research Projects Agency
Google, Inc.
Isaac Newton Trust
Thales E-Securit