Skip to content

Commit 272592b

Browse files
committed
scheduler: (runcount) Exlain absence of atomic-box-compare-and-swap!.
Closes: #48 Reported-by: cireu (with some adjustments) * fibers/scheduler.scm (run-scheduler)[run-task]: Explain it.
1 parent 3ba92d9 commit 272592b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fibers/scheduler.scm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ value. Return zero values."
284284
(cur (scheduler-current-runqueue sched))
285285
(steal-work! (work-stealer sched)))
286286
(define (run-task task)
287+
;; The only thread writing to the runcount box is the thread of SCHED,
288+
;; so no need for atomic-box-compare-and-swap! here.
287289
(atomic-box-set! runcount-box
288290
(logand (1+ (atomic-box-ref runcount-box)) #xffffFFFF))
289291
(call-with-prompt tag

0 commit comments

Comments
 (0)