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
What steps will reproduce the problem?
Compile and run example.
What is the expected output?
miha@miha-work:~/testi/go_sleep $ ./go_sleep
strength = 3 cnt = 3
Parent before sleep
[6 15 113]
Child before sleep
[6 15 113]
Parent after sleep
Child after sleep
What do you see instead?
miha@miha-work:~/testi/go_sleep $ ./go_sleep
strength = 3 cnt = 3
Parent before sleep
[6 15 113]
Child before sleep
[6 15 113]
Parent after sleep
Which compiler are you using (5g, 6g, 8g, gccgo)?
go build
Which operating system are you using?
Ubuntu 12.10
Linux miha-work 3.5.0-32-generic #53-Ubuntu SMP Wed May 29 20:23:04 UTC 2013 x86_64
x86_64 x86_64 GNU/Linux
Which version are you using? (run 'go version')
go version go1.1.2 linux/amd64
Forked child will block at 'time.Sleep(time.Milliecond)' function call, if
'rand.Reader.Read(k)' before fork.
Thank you for response.
I don't understand two things.
1.) Why am I able to fork if I'm not suppose to?
2.) Fork is basic and common system call. Why fork is not supported?
There is no reasonable way for a threaded program to call fork, and Go programs are
always threaded.
You didn't say why you want to call fork, but you may want to look at issue #227.
by mihael.dimec:
Attachments:
The text was updated successfully, but these errors were encountered: