|
From: | Nala Ginrut |
Subject: | Re: wip-threads-and-fork |
Date: | Fri, 24 Feb 2012 11:00:12 +0800 |
On Thu 23 Feb 2012 16:49, Nala Ginrut <address@hidden> writes:Open-process is at the guts of the (ice-9 popen) modules. Open-pipe* is
> 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.
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/
[Prev in Thread] | Current Thread | [Next in Thread] |