Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ok, I'm hooked - how is setting an env var in the current process unsafe? My gut says it's not unsafe in a memory-ownership sense, but rather in a race condition sense?

whatever the issue is, "setting an env var is unsafe" is so interesting to me that I'm now craving a blog post explaining this



It's a long standing bug, setenv and unsetenv are not thread-safe

https://www.evanjones.ca/setenv-is-not-thread-safe.html


I honestly think using setenv is just a terrible idea.


can you elaborate what is the simpelist alternative?


Simple, you don't set any env vars after starting new threads





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: