Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
confuse about wakep?
59 views
Skip to first unread message
xie cui
unread,
Feb 23, 2021, 8:15:42 AM
2/23/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
https://github.com/golang/go/blob/master/src/runtime/proc.go#L2441
why not
change to if !atomic.Cas(&sched.nmspinning, 0, 1), it seems check sched.nmspinning no zero is unneccessary in logic,
i am not sure, i guess it's about performence issue?
Ian Lance Taylor
unread,
Feb 23, 2021, 11:25:39 PM
2/23/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to xie cui, golang-nuts
An atomic load is faster than an atomic compare-and-swap. In
particular, on amd64, an atomic load is just an ordinary load
instruction.
Ian
Reply all
Reply to author
Forward
0 new messages