Apr 23, 2020

[Go] posix thread TLS(slow) call by Go

Thread Local Storage(TLS)  is slow. (TLPI Ch.31.3.1, Ch.31.4)

Discussion thread:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/golang-nuts/tGamryo50BY/gKxPGwBdAwAJ


Steps:

  1. Using runtime.LockOSThread to lock this go-routine to the underlying P
  2. Call cgo/c SO.
  3. Use channel to pass down messages, other go-routine might be scheduled out of this P(most likely won't if listen to same channel)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.