You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see (atomic-box-set! box (+ (atomic-box-ref ...) ...)) pattern here, but IIUC this will cause race condition in multithreading context, the box maybe update after atomic-box-ref and before atomic-box-set! by other threads.
That's incorrect, you are using Lisp's defun instead of Scheme's define.
I think the old implementation is correct, because there is no multithreading here -- IIUC, the only thread modifying the scheduler's runcount box is the scheduler thread.
I'll need to look more carefully to verify this, but I think the bug here is a missing comment explaining this.
https://github.com/wingo/fibers/blob/master/fibers/scheduler.scm#L272
I see
(atomic-box-set! box (+ (atomic-box-ref ...) ...))
pattern here, but IIUC this will cause race condition in multithreading context, the box maybe update afteratomic-box-ref
and beforeatomic-box-set!
by other threads.I think this implementation is correct
The text was updated successfully, but these errors were encountered: