github.com/aclements/go-misc@v0.0.0-20240129233631-2f6ede80790c/memmodel/hbunordered.go (about)

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package main
     6  
     7  // HBUnordered is an HBGenerator that implements fully relaxed memory
     8  // order where the *only* order observed is local program order. This
     9  // corresponds to how programming languages typically specify
    10  // non-atomic loads and stores, which is even weaker than typical
    11  // hardware RMO because loads aren't coherent (loads of the same
    12  // location may be reordered).
    13  type HBUnordered struct{}
    14  
    15  func (HBUnordered) HappensBefore(p *Prog, i, j PC) HBType {
    16  	return HBConcurrent
    17  }
    18  
    19  func (HBUnordered) String() string {
    20  	return "Unordered"
    21  }