I am fine with affinity changes during, say, a mutex or channel operation. But does (or merely can) Go preempt the execution of leaf assembly functions, basically re-creating threads in user space? Or is the currently assigned thread mapping locked until the function decides to return, as cooperative multitasking would suggest?
poniedziałek, 7 listopada 2022 o 19:01:22 UTC+1 Amnon napisał(a): > Go makes no guarantees about the affinity between goroutines and threads, > and the mapping does typically jump around a lot during the execution of > a program. > > On Monday, 7 November 2022 at 17:46:42 UTC ren...@ix.netcom.com wrote: > >> Do you mean Go assembly or an assembly function called via CGo? >> >> On Nov 7, 2022, at 11:28 AM, Piotr Wyderski <piotr.w...@gmail.com> wrote: >> >> >> >> Hello, >> >> A goroutine needs ultimately to be assigned to an OS thread. If a >> goroutine calls an assembly function F, can the thread assignment change >> during the execution of F? >> In other words, is F guaranteed to return on the same thread it was >> called? >> >> Best regards, Piotr >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/03f2cf25-7e52-41ca-ac20-a04877d5df9dn%40googlegroups.com >> >> <https://groups.google.com/d/msgid/golang-nuts/03f2cf25-7e52-41ca-ac20-a04877d5df9dn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e53412c6-574f-4b6e-8e66-35673840fa6dn%40googlegroups.com.