On Wed, Apr 29, 2020 at 12:45 PM <nanoka...@gmail.com> wrote:
>
> 1) I have heard gccgo can call C much quicker than the standard go
> implementation can. If this statement is true, why is that?

It's because gccgo uses the C calling convention.  So you can use a
magic //go:linkname comment to rename a Go function declaration to a C
function, and then just call it.  This is completely unsafe, because
if the C function blocks or misuses pointers your program will crash
horribly.  But it is fast.

> 2) How could a systemstack-like function but which can be friends with
> preemption mechanism of Go 1.14 be achieved?

That is basically a cgo call: a preemption friendly switch to the system stack.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWvk_f7JbpQgzOM17mKBRxwSA0Fb_3k2G34sX3KcLh8DQ%40mail.gmail.com.

Reply via email to