Hello, I'm reading golang source code, it's in version 1.8. some times, I
got some functions like: (runtime/proc.go, function main):
107 func main() {
108 g := getg()
109
110 // Racectx of m0->g0 is used only as the parent of the main
goroutine.
111 // It must not be
Hi, all:
I'm reading golang runtime implementation, I've got a function
definition:
// getg returns the pointer to the current g.
// The compiler rewrites calls to this function into instructions
// that fetch the g directly (from TLS or from the dedicated register).
func getg() *g
hello, is there any replacement for `fork` syscall in Golang?
I've found:
- exec.Command
- syscall.ForkExec
but `exec.Command` can only execute a out side command.
syscall.ForkExec is needless, because what I need is `fork` only.
just like the C-way, fork, and return pid, then I entry