Re: [ovs-dev] [PATCH 11/15] datapath-windows: Add RefCount.h

2014-08-21 Thread Samuel Ghinet
to refCount =0 and to refCount = 1, so the first reference to the object would start at refCount = 2. Sam From: Nithin Raju [nit...@vmware.com] Sent: Saturday, August 16, 2014 7:50 AM To: Samuel Ghinet Cc: dev@openvswitch.org Subject: Re: [ovs-dev] [PA

Re: [ovs-dev] [PATCH 11/15] datapath-windows: Add RefCount.h

2014-08-15 Thread Nithin Raju
On Aug 6, 2014, at 9:14 AM, Samuel Ghinet wrote: > How it works: > Say we have a list of OVS_FLOWs, where OVS_FLOW uses OVS_REF_COUNT. > > * The OVS_REF_COUNT must be initialized to 0 at object creation. > * Assign a destruction function to the func ptr "Destroy" of OVS_REF_COUNT. > * When you

[ovs-dev] [PATCH 11/15] datapath-windows: Add RefCount.h

2014-08-06 Thread Samuel Ghinet
Add RefCount.h The struct that needs to benefit of reference counting should have an "OVS_REF_COUNT" field as the first field in that struct. What it does: * It helps shortening the time a spin lock / rw lock is held (the spin lock & rw lock block the cpu). * It allows deferred object destructi