Skip to content

Commit bcf3f32

Browse files
committed
Sch: Generate guaranteed unique uid
1 parent 96b2c6b commit bcf3f32

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sch/Sch.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ struct ComputeState
9797
chan::RemoteChannel{Channel{Any}}
9898
end
9999

100+
const UID_COUNTER = Threads.Atomic{UInt64}(1)
101+
100102
function start_state(deps::Dict, node_order, chan)
101-
state = ComputeState(rand(UInt64),
103+
state = ComputeState(Threads.atomic_add!(UID_COUNTER, UInt64(1)),
102104
OneToMany(),
103105
deps,
104106
Vector{Thunk}(undef, 0),

0 commit comments

Comments
 (0)