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
We need a store-store barrier between pushing the registers to the
current stack and setting the resumable flag of the current fiber,
otherwise the CPU is allowed to reorder the instructions at runtime and
to store the resumable flag before or while storing the registers.
This can happen for example:
thread 1: enqueues current fiber A
therad 1: swapcontext -> store resumable
thread 1: is preempted
thread 2: steals fiber A
thread 2: resumes fiber A
thread 2: loads registers => reads garbage => segfaults
thread 1: stores registers (too late)
0 commit comments