On Tue, Feb 11, 2014 at 04:30:44PM -0800, Jarno Rajahalme wrote:
> Reading the hmap count for determining if it is empty or not is thread
> safe, so avoid locking when not necessary.
> 
> Signed-off-by: Jarno Rajahalme <jrajaha...@nicira.com>

It might be worth adding an atomic_thread_fence(memory_order_acquire);
before the hmap_is_empty() checks, so that we can be sure to get "fresh"
results in case that some other CPU has modified the hmap.  (On x86,
with GCC 4.7, this generates no code.)
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to