Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card Build Status

Introduction

lock-free / mutex-free and thread-safe lists written in Go

Supports 1.18 generics

Example

Queue

func main() {
    var queue lists.Queue[int]
    // producer
    for i:=0; i<100; i++ {
        queue.Push(i)
    }
    // consumer
    var v int
    for queue.Pop(&v) {
        fmt.Println(v)
    }
    // 0
    // 1
    // 2
    // ...
    // 98
    // 99
}

Stack

func main() {
    var stack lists.Stack[int]
    // producer
    for i:=0; i<100; i++ {
        stack.Push(i)
    }
    // consumer
    var v int
    for stack.Pop(&v) {
        fmt.Println(v)
    }
    // 99
    // 98
    // ...
    // 1
    // 0
}

About

lock-free and thread-safe implementation of lists written in Go

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages