Getting a live view of environment variables (Gradle and JDK 9)

David Holmes david.holmes at oracle.com
Wed May 17 21:15:18 UTC 2017


On 18/05/2017 2:36 AM, Martin Buchholz wrote:
> Stop trying to add APIs to mutate environment variables.  It's not going
> to happen!

Not sure who or what you are directing this at Martin. Certainly I'm not 
suggesting any API to mutate environment variables. This is about an API 
to re-read an already potentially mutated external environment.

> There is no known way to mutate environment variables in a
> multithreaded Unix process without risk of native crashes (and I have
> worn the hat of poor support engineer trying to diagnose SEGV in
> getenv).  IIRC we made the decision 13 years ago to cache the
> environment on first access, and that was before the thread-unsafety of
> putenv was fully appreciated.
>
> Yes, Java still has a serious startup performance problem; that should
> be attacked more directly.

?? Not sure what startup has to do with the topic here.

David


More information about the core-libs-dev mailing list