[ovs-dev] [seq 4/5] seq: New module for race-free, pollable, thread-safe sequence number.

Andy Zhou azhou at nicira.com
Mon Aug 12 16:55:39 UTC 2013


On Sat, Aug 10, 2013 at 8:51 PM, Ben Pfaff <blp at nicira.com> wrote:

> On Sat, Aug 10, 2013 at 04:32:11PM -0700, Andy Zhou wrote:
> > Sorry for the delay in review.  It took me a while to understand the
> design
> > intent to be able to understand the logic.
>
> Thanks for the review.
>
> If the design intent is unclear, then maybe I could make the code
> clearer.  I want my code to be easy to understand.  Can you think of
> some change that would make it more obvious?
>
One aspect of the design took me while to understand is that when thread
woke up, it does not necessarily know which 'seq'(s) caused it to wake up
and it is
intentional.

>
> > A design question:  It seems  'seq' API expects seq numbers to be
> > monotonically increasing. is this true? If yes, would it make sense to
> add
> > some asserts?
>
> The seq numbers should be monotonically increasing, but I am not sure
> what asserts would help.  What do you suggest?
>
The code is fine.  I did not realize that the seq_wait() API can handle
value less than seq->value correctly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130812/f49d04e4/attachment-0003.html>


More information about the dev mailing list