Benefits of runtime.LockOSThread in Golang

后端 未结 3 1533
轻奢々
轻奢々 2020-12-15 19:50

Golang supports LockOSThread() to make current goroutine exclusively tied to current OS thread, and it can also UnlockOSThread().

Are there

3条回答
  •  温柔的废话
    2020-12-15 19:53

    runtime.LockOsThread it is usually used for calling C code that requires running in the main thread, like in graphics libraries.

    Go Wiki page about LockOsThread and an example on how to use it.

    Google groups discussion about the use of LockOsThread in SDL.

提交回复
热议问题