On Thu 23 Feb 2012 16:49, Nala Ginrut <nalagin...@gmail.com> writes: > I just want to do my negative vote when I saw "choose thead then fork > die", but I see "open-process" soon. ;-) So, what's the difference > between "primitive-fork" and "open-process"? If they're different, I > think much code to be modified for me...I believe I'm not the only > layman to use "fork" and "thread" both.
Open-process is at the guts of the (ice-9 popen) modules. Open-pipe* is a thin wrapper around it -- see "Pipes" in the manual. Basically open-pipe* / open-process does a fork(), and then an exec(). Doing this yourself in Scheme is actually impossible with threads, because you'll need to take Scheme strings and produce C strings in the current locale, to pass to the exec call. That involves malloc, iconv, and libgc allocation, and none of them are guaranteed to work after a fork(), in a multithreaded program. Andy -- http://wingolog.org/