Conference Paper

Cooperative Task Management Without Manual Stack Management.

Conference: Proceedings of the General Track: 2002 USENIX Annual Technical Conference, June 10-15, 2002, Monterey, California, USA
Source: DBLP


Abstract Cooperative task management can provide program ar - chitects with ease of reasoning about concurrency is - sues This property is often espoused by those who recommend "event - driven" programming over "multi - threaded" programming Those terms conflate several issues In this paper, we clarify the issues, and show how one can get the best of both worlds: reason more simply about concurrency in the way "event - driven" advocates recommend, while preserving the readability and main - tainability of code associated with "multithreaded" pro - gramming We identify the source of confusion about the two pro - gramming styles as a conflation of two concepts: task management and stack management Those two con - cerns define a two - axis space in which "multithreaded" and "event - driven" programming are diagonally oppo - site; there is a third "sweet spot" in the space that com - bines the advantages of both programming styles We point out pitfalls in both alternative forms of stack man - agement, manual and automatic , and we supply tech - niques that mitigate the danger in the automatic case Finally, we exhibit adaptors that enable automatic stack management code and manual stack management code to interoperate in the same code base

Full-text preview

Available from:
  • Source
    • "This allows the host-level debugger to automatically gain knowledge about the location of our simulated stacks through the list of threads, thus ensuring very reliable backtraces during debugging sessions. Optionally, we provide a more efficient ucontext-based [3] stack manager to allocate stack space with mmap and control the Program Counter of each simulated process by saving and restoring CPU registers entirely in user-space. Similarly, we take great care to track and isolate the heap of each simulated process. "
    [Show abstract] [Hide abstract]
    ABSTRACT: We describe the first capability, to our knowledge, to execute nearly unmodified applications and Linux kernel code in the context of a widely-used open source discrete event networking simulator (ns-3). We propose Direct Code Execution (DCE), a framework that dramatically increases the number of available protocol models and realism available for ns-3 simulations. DCE meets the goals recently proposed for fully reproducible networking research and runnable papers, with the added benefits of 1) the ability of completely deterministic reproducibility, 2) the scalability that simulation time dilation offers, 3) capabilities supporting automated code coverage analysis, and 4) improved debuggability via execution within a single address space. In this paper, we describe in detail DCE, report on packet processing benchmark and showcase key features of the framework with different use cases. Next, we reproduce a previously published Multipath TCP (MPTCP) experiment and highlight how code coverage testing can be automated by showing results achieving 55-86% coverage of the MPTCP implementation. Then we demonstrate how network stack debugging can be easily performed and reproduced across a distributed system. Our first benchmarks are promising and we believe this framework can benefit the network community by enabling realistic, reproducible experiments and runnable papers.
    Full-text · Conference Paper · Dec 2013
  • Source
    • "Interestingly enough, authors of similar systems for imperative languages commonly acknowledge that static checking would be preferable, but do not implement it [5] [19]. It seems that Kilim statically checks @pausable annotations, although the authors do not mention it explicitly [38]. "
    [Show abstract] [Hide abstract]
    ABSTRACT: Coroutines and events are two common abstractions for writing concurrent programs. Because coroutines are often more convenient, but events more portable and efficient, it is natural to want to translate the former into the latter. CPC is such a source-to-source translator for C programs, based on a partial conversion into continuation-passing style (CPS conversion) of functions annotated as cooperative. In this article, we study the application of the CPC translator to QEMU, an open-source machine emulator which also uses annotated coroutine functions for concurrency. We first propose a new type of annotations to identify blocking functions, and we introduce CoroCheck, a tool for the static analysis and inference of cooperation and blocking annotations. Then, we improve the CPC translator, defining CPS conversion as a calling convention for the C language, with support for indirect calls to CPS-converted function through function pointers. Finally, we apply CoroCheck and CPC to QEMU (750 000 lines of C code), fixing hundreds of missing annotations and comparing performance of the translated code with existing implementations of coroutines in QEMU. Our work shows the importance of static annotation checking to prevent actual concurrency bugs, and demonstrates that CPS conversion is a flexible, portable, and efficient compilation technique, even for very large programs written in an imperative language.
    Preview · Article · Oct 2013
  • Source
    • "As a result, the control flow of the driver is scattered across multiple entry points and cannot be reconstructed from its source code. This phenomenon is known as stack ripping [1] "
    [Show abstract] [Hide abstract]
    ABSTRACT: We develop a practical solution to the problem of automatic verification of the interface between device drivers and the OS. Our solution relies on a combination of improved driver architecture and verification tools. It supports drivers written in C and can be implemented in any existing OS, which sets it apart from previous proposals for verification-friendly drivers. Our Linux-based evaluation shows that this methodology amplifies the power of existing verification tools in detecting driver bugs, making it possible to verify properties beyond the reach of traditional techniques.
    Full-text · Article · Nov 2012
Show more