[plt-scheme] set environment variables in subprocess

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Wed Jan 13 20:12:08 EST 2010

I guess you'd have to serialize the actual creation of the processes,
or use yet another process to first set its own variables than exec
the cgi program.

Robby

2010/1/13 YC <yinso.chen at gmail.com>:
>
> On Wed, Jan 13, 2010 at 4:00 PM, David Brown <plt at davidb.org> wrote:
>>
>> On Wed, Jan 13, 2010 at 03:07:59PM -0800, YC wrote:
>>
>>> is there a way to set the environment variables for the subprocess?  Looking
>>> at http://docs.plt-scheme.org/reference/subprocess.html it was not clear how
>>> this can be accomplished.
>>
>> The 'subprocess' call calls execv on Unix/Linux, so you would have to
>> set it in the current process before the subprocess is created, which
>> you could do with 'putenv'.
>
> Thanks Jay & Dave.  setenv & putenv modifies the current process's environment variable, so it sounds like if you want to spawn multiple subprocesses in multi-threaded fashion you will have some sort of contention if you are setting more than one environment variables. The example I am thinking about is spawning CGI processes, where the headers are written into the environment variables.
>
> Are there other ways or is my concern moot?  Thanks,
> yc
>
>
>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>


Posted on the users mailing list.