You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to call Go function from C program as like a static library. and I was trying to make my C daemon program using fork(). but as you see in my _main.c code(in my reop), Go function call hanging forever in child process.
Thank you in advance for your help.
The text was updated successfully, but these errors were encountered:
wickedev
changed the title
Go function call is hanging forever in C child process.
runtime: Go function call is hanging forever in C child process.
Mar 11, 2016
In general fork does not work with multi-threaded processes, and Go programs are always multi-threaded. A simple fork/exec that does not call any Go code between fork and exec should work. An attempt to call Go code after fork will generally fail, as you are seeing.
There is really no way to fix this, so I am going to close this issue. If you want to discuss this, please use a forum, not the issue tracker; see https://golang.org/wiki/Questions.
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.6 linux/amd64
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
go env
)?If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
my example program
I wanna call Go function in C child process
I'd like to call Go function from C program as like a static library. and I was trying to make my C daemon program using fork(). but as you see in my
_main.c
code(in my reop), Go function call hanging forever in child process.Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: