%0 Conference Paper %B PADTAD'12: Proceedings of the 10th Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging %D 2012 %T Using Program Closures to Make an Application Programming Interface (API) Implementation Thread Safe %A Farchi, Eitan %A Segall, Itai %A João M. Lourenço %A Sousa, Diogo %C Minneapolis, MN, USA %I ACM %K concurrency %K software transactional memory %K static analysis %K testing %K verification %S PADTAD %X

A set of methods defining an API (Application Programming Interface) are to be made thread safe; thus running any subset of these methods in parallel should not create races or deadlocks. Originally, the set of methods were not designed to be thread safe, so races and deadlocks are expected when running them in parallel. The number of possible interleavings when running methods from this API in parallel is huge, and this work focuses on the identification of the high level data races introduced by such interleavings. We propose an analysis that avoids the exhaustive exploration of all possible interleavings. For a concurrent program P, the closure of P, clos(P), is defined. Roughly speaking, we can say that the clos(P) is obtained by adding threads to P in such a way that high level data races resulting from running P in parallel to other programs are exposed statically. A set of methods representing the API is then modeled as a set of concurrent programs and their closure is analysed to identify high level data races. These high level data races are then inspected and removed to make the API thread safe. We illustrate the application of this methodology with a simple use case.

%Z

n/a

%> https://docentes.fct.unl.pt/sites/default/files/joao-lourenco/files/programclosure.pdf