from Hacker News

Golang Sync Mutex: Normal and Starvation Mode

by lcof on 8/10/24, 10:42 PM with 14 comments

  • by mrkeen on 8/11/24, 9:26 AM

    > Mutex, or MUTual EXclusion, in Go is basically a way to make sure that only one goroutine is messing with a shared resource at a time. This resource can be a piece of code, an integer, a map, a struct, a channel, or pretty much anything.

    This is untrue right? It can only protect code, not data, right?

  • by Animats on 8/11/24, 5:47 AM

    I have misgivings about such long spinlocks in user space. A millisecond is over a million instructions.