A method to update a data structure is disclosed. The method receives a
write thread, and sets a data structure indicator to indicate that the
data structure is unusable. The method creates (N) thread indicators, and
assigns each of said (N) indicators to a different one of said (N)
threads. Upon return to the thread dispatcher, the (i)th thread sees the
data structure indicator which shows that the data structure is unusable.
The method then sets the (i)th thread indicator to indicate that upon
subsequent dispatches the (i)th thread will see the data structure
indicator that shows that the data structure is unusable. After each of
the (N) threads has seen the data structure indicator marking the data
structure as unusable, the method sets the data structure indicator to
indicate that the data structure is invalid, updates the data structure,
and sets the data structure indicator to indicate that the data structure
is valid.