ANN: Sarge, a library wrapping the subprocess module, has been released.

Anh Hai Trinh anh.hai.trinh at gmail.com
Sun Feb 12 11:19:18 EST 2012


> For a careful impl of fork-exec with threads, see http://golang.org/src/pkg/syscall/exec_unix.go

I forgot to mention that this impl is indeed "correct" only because you cannot start thread or call fork() directly in the Go language, other than use goroutines and the ForkExec() function implemented there. So all that locking is internal.

If you use threads and call fork(), you'll almost guaranteed to face with deadlocks. Perhaps not in a particular piece of code, but some others. Perhaps not on your laptop, but on the production machine with different kernels. Like most race conditions, they will eventually show up.



More information about the Python-list mailing list