A memory model sensitive checker for c#

  • Authors:
  • Thuan Quang Huynh;Abhik Roychoudhury

  • Affiliations:
  • Department of Computer Science, National University of Singapore;Department of Computer Science, National University of Singapore

  • Venue:
  • FM'06 Proceedings of the 14th international conference on Formal Methods
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Modern concurrent programming languages like Java and C# have a programming language level memory model; it captures the set of all allowed behaviors of programs on any implementation platform — uni- or multi-processor. Such a memory model is typically weaker than Sequential Consistency and allows reordering of operations within a program thread. Therefore, programs verified correct by assuming Sequential Consistency (that is, each thread proceeds in program order) may not behave correctly on certain platforms! The solution to this problem is to develop program checkers which are memory model sensitive. In this paper, we develop such an invariant checker for the programming language C#. Our checker identifies program states which are reached only because the C# memory model is more relaxed than Sequential Consistency. Furthermore, our checker identifies (a) operation reorderings which cause such undesirable states to be reached, and (b) simple program modifications — by inserting memory barrier operations — which prevent such undesirable reorderings.