Skip to content
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

Add jl_getaffinity and jl_setaffinity #53402

Merged
merged 18 commits into from
May 25, 2024
Merged
Prev Previous commit
Next Next commit
drop windows test
  • Loading branch information
carstenbauer committed Apr 17, 2024
commit ff829a94bbb095a03853cb8ffca8a647fe14a2c4
5 changes: 2 additions & 3 deletions test/threads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,12 @@ end

@testset "jl_*affinity" begin
cpumasksize = @ccall uv_cpumask_size()::Cint
if cpumasksize > 0 # otherwise affinities are not supported on the platform (UV_ENOTSUP)
if !Sys.iswindows() && cpumasksize > 0 # otherwise affinities are not supported on the platform (UV_ENOTSUP)
mask = zeros(Cchar, cpumasksize);
jl_getaffinity = (tid, mask, cpumasksize) -> ccall(:jl_getaffinity, Int32, (Int16, Ptr{Cchar}, Int32), tid, mask, cpumasksize)
jl_setaffinity = (tid, mask, cpumasksize) -> ccall(:jl_setaffinity, Int32, (Int16, Ptr{Cchar}, Int32), tid, mask, cpumasksize)
@test jl_getaffinity(1, mask, cpumasksize) == 0
fill!(mask, 0)
mask[begin] = 1
fill!(mask, 1)
@test jl_setaffinity(1, mask, cpumasksize) == 0
end
end