New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
not thread safe? #4986
Comments
From rotwang@crux.org.plHi, recently when trying to parallelise fetching multiple websites with getenv should be threadsafe according to: # Non parallelised version works as expected: # Lets try it parallelised (this time worked): Camelia from freenode: 21:07 <Rotwang> m: use NativeCall; sub getenv(Str) is native returns Str { 21:08 <Rotwang> m: use NativeCall; sub getenv(Str) is native returns Str { 21:09 <Rotwang> m: use NativeCall; sub getenv(Str) is native returns Str { Issue doesn't happen every time, so at times it may be hard to reproduce, |
From @lizmat
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html seems to claim otherwise? "The getenv() function is inherently not thread-safe because it returns a value pointing to static data.� Liz |
The RT System itself - Status changed from 'new' to 'open' |
From @geekosaurOn Mon, Jan 4, 2016 at 10:51 AM, Elizabeth Mattijsen <liz@dijkmat.nl> wrote:
From the first link claiming that getenv() is thread safe... how are you "the following functions need not be thread-safe: (...) getenv()" Also note below the function list: Since multi-threaded applications are not allowed to use the (plus a link to the environment variables documentation which explicitly -- |
From rotwang@crux.org.plI've already corrected myslef (but somehow my second email didn't make it Actually getenv isn't thread safe but rakudo shouldn't crash anyway. Here $ cat foo.c int foo(void) { return 0; } and here is another: 01:03 < Rotwang> m: use NativeCall; sub puts(Str) is native returns int32 { besides even if the function is not thread safe, IMO rakudo shouldn't 2016-01-04 15:58 GMT+00:00 Brandon Allbery via RT <
|
Migrated from rt.perl.org#127138 (status was 'open')
Searchable as RT127138$
The text was updated successfully, but these errors were encountered: