github.com/lrita/numa@v1.0.2/README.md (about)

     1  # NUMA
     2  
     3  [![Build Status](https://travis-ci.org/lrita/numa.svg?branch=master)](https://travis-ci.org/lrita/numa) [![GoDoc](https://godoc.org/github.com/lrita/numa?status.png)](https://godoc.org/github.com/lrita/numa) [![codecov](https://codecov.io/gh/lrita/numa/branch/master/graph/badge.svg)](https://codecov.io/gh/lrita/numa) [![Go Report Card](https://goreportcard.com/badge/github.com/lrita/numa)](https://goreportcard.com/report/github.com/lrita/numa)
     4  
     5  NUMA is a utility library, which is written in go. It help us to write
     6  some NUMA-AWARED code.
     7  
     8  example gist:
     9  ```go
    10  package main
    11  
    12  import (
    13  	"github.com/lrita/numa"
    14  )
    15  
    16  type object struct {
    17  	X int
    18  	_ [...]byte // padding to page size.
    19   }
    20  
    21  var objects = make([]object, numa.CPUCount())
    22  
    23  func fnxxxx() {
    24  	cpu, node := numa.GetCPUAndNode()
    25  	objects[cpu].X = xx
    26  }
    27  ```