LWN.net Logo

Two sequence numbers

Two sequence numbers

Posted Feb 2, 2003 5:02 UTC (Sun) by Ross (subscriber, #4065)
Parent article: Fast reader/writer locks

Are there really two sequence numbers (one pre and one post) as the article implies? If so, why?

I don't see why this wouldn't work with only one sequence number inside the lock. The interface for readers would be the same. Is this to avoid needing atomic reads or something?

Yes, yes, I know I can go read the code.
But I'd be much happier if someone who understands this would explain it. ;)


(Log in to post comments)

Re: Two sequence numbers

Posted Feb 6, 2003 5:46 UTC (Thu) by Ross (subscriber, #4065) [Link]

I think I got my answer. It changed to the way I suspected it could sometime since last week.

From http://lwn.net/Articles/21812/:

"Changes:
- name change frlock to seqlock
- separate the locking and counter only data types
- use one counter instead of two to keep track of changes."

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds