-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorhelp wantedIndicates that a maintainer wants help on an issue or pull requestIndicates that a maintainer wants help on an issue or pull requestsystem:windowsAffects only WindowsAffects only Windows
Description
The following c# code...
Environment.SetEnvironmentVariable("JULIA_NUM_THREADS", "4");
jl_init_with_image__threading(mBinPath, mSysImg);
jl_eval_string("println(\"Threads=$(Threads.nthreads())\")");
jl_eval_string("println(\"JULIA_NUM_THREADS=$(ENV[\"JULIA_NUM_THREADS\"])\")");
Produces the following output
Threads=1
JULIA_NUM_THREADS=4
In discussions with the Jeff and Keno it appears this happens in Windows because there are several environment stores in Windows, and the threads are created by reading with getenv
(which access the machine level environment), while later in Julia the ENV
is retrieved using getenvw
(which access the process level environment).
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorhelp wantedIndicates that a maintainer wants help on an issue or pull requestIndicates that a maintainer wants help on an issue or pull requestsystem:windowsAffects only WindowsAffects only Windows