stats: use a sequence number
If the host wants a consistent view (*if* it wants it), it
can wait for the sequence number to be even, read the lot and
then check it did not change.
If it is odd, it means the structure is being modified. If it changed
after reading it means a new modification started.
Not my invention: it's old stuff, though smart. See sequential locks
in the kernel for example.
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Showing
Please
register
or
sign in
to comment