[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wip-threads-and-fork
From: |
Andy Wingo |
Subject: |
Re: wip-threads-and-fork |
Date: |
Thu, 23 Feb 2012 17:13:56 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
On Thu 23 Feb 2012 16:49, Nala Ginrut <address@hidden> 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/
- wip-threads-and-fork, Andy Wingo, 2012/02/08
- Re: wip-threads-and-fork, Andy Wingo, 2012/02/22
- Re: wip-threads-and-fork, Andy Wingo, 2012/02/23
- Re: wip-threads-and-fork, Nala Ginrut, 2012/02/23
- Re: wip-threads-and-fork,
Andy Wingo <=
- Re: wip-threads-and-fork, Nala Ginrut, 2012/02/23
- Re: wip-threads-and-fork, Andy Wingo, 2012/02/24
- Re: wip-threads-and-fork, Nala Ginrut, 2012/02/24
- Re: wip-threads-and-fork, Andy Wingo, 2012/02/24
- Re: wip-threads-and-fork, Nala Ginrut, 2012/02/24
- Re: wip-threads-and-fork, Ludovic Courtès, 2012/02/26
- Re: wip-threads-and-fork, Andy Wingo, 2012/02/27
- Re: wip-threads-and-fork, Andy Wingo, 2012/02/24
- Re: wip-threads-and-fork, Nala Ginrut, 2012/02/24
- Re: wip-threads-and-fork, Nala Ginrut, 2012/02/24