-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
and add some debugging aids, controlled by changing the JULIA_DEBUG_SLEEPWAKE() macro in julia_threads.h
- Loading branch information
Showing
7 changed files
with
108 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,7 @@ | ||
# This file is a part of Julia. License is MIT: https://julialang.org/license | ||
|
||
using Test, Base.Threads | ||
|
||
let p, cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads_exec.jl` | ||
# test both nthreads==1 and nthreads>1. spawn a process to test whichever | ||
# case we are not running currently. | ||
other_nthreads = nthreads() == 1 ? 4 : 1 | ||
p = run(pipeline(setenv(cmd, "JULIA_NUM_THREADS" => other_nthreads), stdout = stdout, stderr = stderr), | ||
wait = false) | ||
include("threads_exec.jl") | ||
if !success(p) | ||
error("threads test failed with nthreads == $other_nthreads") | ||
let cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads_exec.jl` | ||
for test_nthreads in (1, 8, 8) # run once to try single-threaded mode, then try a couple times to trigger bad races | ||
run(pipeline(setenv(cmd, "JULIA_NUM_THREADS" => test_nthreads), stdout = stdout, stderr = stderr)) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters