代码拉取完成,页面将自动刷新
setcpuaffinity(cmd, cpus) for setting CPU affinity of subprocess…
# This file is a part of Julia. License is MIT: https://julialang.org/license
const uv_thread_t = UInt # TODO: this is usually correct (or tolerated by the API), but not guaranteed
function uv_thread_getaffinity()
masksize = ccall(:uv_cpumask_size, Cint, ())
self = ccall(:uv_thread_self, uv_thread_t, ())
ref = Ref(self)
cpumask = zeros(Bool, masksize)
err = ccall(
:uv_thread_getaffinity,
Cint,
(Ref{uv_thread_t}, Ptr{Bool}, Cssize_t),
ref,
cpumask,
masksize,
)
Base.uv_error("getaffinity", err)
n = something(findlast(cpumask)) # we must have at least one active core
resize!(cpumask, n)
return cpumask
end
function print_process_affinity()
join(stdout, findall(uv_thread_getaffinity()), ",")
println()
end
if Base.Filesystem.samefile(PROGRAM_FILE, @__FILE__)
print_process_affinity()
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。