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
Suppose thread A has to do a bunch of extra work in the "modify" step for some reason, such that one of threads B, C, ... has almost always gotten in and updated the variable by the time A gets to the CAS call. Then A might have to retry many, many times before it succeeds.
...
Preshing:
I'm pretty sure individual threads could be made to starve indefinitely.
The text was updated successfully, but these errors were encountered:
About handling:
Once the starvation is detected then a lock (lightweight mutex) could be locked by the starving thread to ensure exclusive access to the shared variable.
This might not work, because
that lock would enforce stricter ordering rules than we had without it
From http://preshing.com/20150402/you-can-do-any-kind-of-atomic-read-modify-write-operation/
...
Preshing:
The text was updated successfully, but these errors were encountered: