Using Program Closures to Make an Application Programming Interface (Api) Implementation Thread Safe

Research output: Chapter in Book/Report/Conference proceedingConference contribution

1 Citation (Scopus)

Abstract

Consider a set of methods implementing an Application Programming Interface (API) of a given library or program module that is to be used in a multithreaded setting. If those methods were not originally designed to be thread safe, races and deadlocks are expected to happen. This work introduces the novel concept of program closure and describes how it can be applied in a methodology used to make the library or module implementation thread safe, by identifying the high level data races introduced by interleaving the parallel execution of methods from the API. High-level data races result from the misspecification of the scope of an atomic block, by wrongly splitting it into two or more atomic blocks sharing a data dependency. Roughly speaking, the closure of a program P, clos(P), is obtained by incrementally adding new threads to P in such a way that enables the identification of the potential high level data races that may result from running P in parallel with other programs. Our model considers the methods implementing the API of a library of program module as concurrent programs and computes and analyses their closure in order to identify high level data races. These high level data races are inspected and removed to make the interface thread safe. We illustrate the application of this methodology with a simple use case.
Original languageUnknown
Title of host publicationPADTAD 2012
Place of PublicationMinneapolis, MN, USA
PublisherACM
Pages18-24
ISBN (Print)978-1-4503-1456-5
DOIs
Publication statusPublished - 1 Jan 2012
EventWorkshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging -
Duration: 1 Jan 2012 → …

Conference

ConferenceWorkshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging
Period1/01/12 → …

Keywords

    Cite this

    @inproceedings{7cbccbc89f0c453ab7e95561e0f340ea,
    title = "Using Program Closures to Make an Application Programming Interface (Api) Implementation Thread Safe",
    abstract = "Consider a set of methods implementing an Application Programming Interface (API) of a given library or program module that is to be used in a multithreaded setting. If those methods were not originally designed to be thread safe, races and deadlocks are expected to happen. This work introduces the novel concept of program closure and describes how it can be applied in a methodology used to make the library or module implementation thread safe, by identifying the high level data races introduced by interleaving the parallel execution of methods from the API. High-level data races result from the misspecification of the scope of an atomic block, by wrongly splitting it into two or more atomic blocks sharing a data dependency. Roughly speaking, the closure of a program P, clos(P), is obtained by incrementally adding new threads to P in such a way that enables the identification of the potential high level data races that may result from running P in parallel with other programs. Our model considers the methods implementing the API of a library of program module as concurrent programs and computes and analyses their closure in order to identify high level data races. These high level data races are inspected and removed to make the interface thread safe. We illustrate the application of this methodology with a simple use case.",
    keywords = "Static Analysis, Atomicity Violation, High-Level Data Race, Concurrency, Debugging",
    author = "Louren{\cc}o, {Jo{\~a}o Manuel dos Santos}",
    year = "2012",
    month = "1",
    day = "1",
    doi = "10.1145/04000802.2336810",
    language = "Unknown",
    isbn = "978-1-4503-1456-5",
    pages = "18--24",
    booktitle = "PADTAD 2012",
    publisher = "ACM",

    }

    Lourenço, JMDS 2012, Using Program Closures to Make an Application Programming Interface (Api) Implementation Thread Safe. in PADTAD 2012. ACM, Minneapolis, MN, USA, pp. 18-24, Workshop on Parallel and Distributed Systems: Testing, Analysis, and Debugging, 1/01/12. https://doi.org/10.1145/04000802.2336810

    Using Program Closures to Make an Application Programming Interface (Api) Implementation Thread Safe. / Lourenço, João Manuel dos Santos.

    PADTAD 2012. Minneapolis, MN, USA : ACM, 2012. p. 18-24.

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

    TY - GEN

    T1 - Using Program Closures to Make an Application Programming Interface (Api) Implementation Thread Safe

    AU - Lourenço, João Manuel dos Santos

    PY - 2012/1/1

    Y1 - 2012/1/1

    N2 - Consider a set of methods implementing an Application Programming Interface (API) of a given library or program module that is to be used in a multithreaded setting. If those methods were not originally designed to be thread safe, races and deadlocks are expected to happen. This work introduces the novel concept of program closure and describes how it can be applied in a methodology used to make the library or module implementation thread safe, by identifying the high level data races introduced by interleaving the parallel execution of methods from the API. High-level data races result from the misspecification of the scope of an atomic block, by wrongly splitting it into two or more atomic blocks sharing a data dependency. Roughly speaking, the closure of a program P, clos(P), is obtained by incrementally adding new threads to P in such a way that enables the identification of the potential high level data races that may result from running P in parallel with other programs. Our model considers the methods implementing the API of a library of program module as concurrent programs and computes and analyses their closure in order to identify high level data races. These high level data races are inspected and removed to make the interface thread safe. We illustrate the application of this methodology with a simple use case.

    AB - Consider a set of methods implementing an Application Programming Interface (API) of a given library or program module that is to be used in a multithreaded setting. If those methods were not originally designed to be thread safe, races and deadlocks are expected to happen. This work introduces the novel concept of program closure and describes how it can be applied in a methodology used to make the library or module implementation thread safe, by identifying the high level data races introduced by interleaving the parallel execution of methods from the API. High-level data races result from the misspecification of the scope of an atomic block, by wrongly splitting it into two or more atomic blocks sharing a data dependency. Roughly speaking, the closure of a program P, clos(P), is obtained by incrementally adding new threads to P in such a way that enables the identification of the potential high level data races that may result from running P in parallel with other programs. Our model considers the methods implementing the API of a library of program module as concurrent programs and computes and analyses their closure in order to identify high level data races. These high level data races are inspected and removed to make the interface thread safe. We illustrate the application of this methodology with a simple use case.

    KW - Static Analysis

    KW - Atomicity Violation

    KW - High-Level Data Race

    KW - Concurrency

    KW - Debugging

    U2 - 10.1145/04000802.2336810

    DO - 10.1145/04000802.2336810

    M3 - Conference contribution

    SN - 978-1-4503-1456-5

    SP - 18

    EP - 24

    BT - PADTAD 2012

    PB - ACM

    CY - Minneapolis, MN, USA

    ER -