develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #31711] embedded perl $ENV{PATH} cannot be changed in instance other than the first

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
May 27, 2013 23:12
Subject:
[perl #31711] embedded perl $ENV{PATH} cannot be changed in instance other than the first
Message ID:
rt-3.6.HEAD-2650-1369696365-62.31711-15-0@perl.org
On Mon May 27 11:23:23 2013, jdb wrote:
> On Sun, May 26, 2013 at 10:19 AM, James E Keenan via RT
> <perlbug-followup@perl.org> wrote:
> > On Fri Sep 24 12:21:12 2004, skartick@scitegic.com wrote:
> >>
> >> I have embedded perl in my c program, however I have encountered a
> >> problem where the $ENV{PATH} can only be updated in the first
> >> PerlInterpreter instance.
> 
> [...]
> 
> >> Any ideas, suggestions.  I have tried this on win32 and it works fine.
> >
> > Is there anyone familiar with embedded Perl who could evaluate the
> > problem described in this older ticket?
> 
> This behavior is by design: the POSIX environment is shared by all
> threads in a process, so Perl limits access to the OS level
> environment to the first Perl interpreter instantiated in a process.
> This was done with ithreads in mind, but applies equally to multiple
> embedded interpreters if Perl was compiled with USE_ITHREADS:
> 
> http://perl5.git.perl.org/perl.git/blob/HEAD:/util.c#l1887
> 
> On Windows Perl uses a virtualized environment (PerlHost), which does
> keep per-interpreter copies of things like the environment and the
> cwd, and uses these for spawning subprocesses.
> 
> Implementation of a similar hosting layer for Unix is still a wishlist
item:
> 
> http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/todo.pod#l1022
> 
> A workaround for embedding might be to compile Perl without
> USE_ITHREADS. I haven't thought through the potential implications
> this might have for running multiple interpreters concurrently in
> different threads in this configuration.
> 
> Cheers,
> -Jan
>

Thanks for responding, Jan.  I'll take this ticket for the purpose of
closing it in seven days unless we get good arguments to the contrary.

Thank you very much.
Jim Keenan



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=31711

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About