On Tue, Jan 8, 2019 at 4:56 AM Jan Mercl <0xj...@gmail.com> wrote:
>
> When an ordinary goroutine (not a CGo call into C) executes 
> runtime.LockOSThread, does its stack become the OS thread stack? In 
> particular, I'm interested if that guarantees fixed (pinned) pointers 
> pointing into the stack. If the real OS thread stack is used then that should 
> work, I guess, but I'd like to be enlightened by someone who knows the 
> runtime.

No.  The stack remains the goroutine stack, and it is possible for
pointers into the stack to change if the stack is copied.

> Also, do gc and gccgo differ wrt this question?

No.  (In the current gccgo stacks are split, not copied, so stacks
never move, but there is no promise that that will continue to be the
case in the future.  In any case, with gccgo, when using LockOSThread,
the goroutine will still use the goroutine stack, and it will still be
split as needed.)

Ian

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to