Hi Rob,

> -----Original Message-----
> From: users [mailto:[email protected]] On Behalf Of Rob
> Zimmerman
> Sent: Monday, February 13, 2017 2:26 PM
> To: [email protected]
> Subject: [dpdk-users] Is Elastic Flow Distributor thread-safe?
> 
> Hi Everyone,
> 
>   Playing around with EFD and seeing some really bizarre behavior in a
> multi-core environment. Is it safe for multiple logical cores to be making
> EFD table updates while another logical core is performing lookups? Side
> note: the core which is making lookups is where the offline table resides.
> 
> Intuition tells me this is probably not safe, but the docs make no mention
> of thread safety.

The library is not thread-safe. The only operation that is thread safe is the 
lookup.

However, although update is not thread safe, it is interesting to know the 
following.
Updating the EFD table consists of two steps:

1 - Compute Update: the new key is added to the offline group, which is not 
thread safe.
     Then, a new perfect hash for the group is computed (thread safe and where 
most of time is spent).

2 - Apply Update: Once the update is computed, it has to be applied to the 
online table (fast, but not thread safe).

Multi-writer support might be added in the future, as it was added in the Hash 
library.

For now, several readers can work simultaneously, as long as there is no writer 
working on it (you would need locks for this),
and only a single writer is supported if there is no other core doing lookups.
 
> 
> Thanks,
> -Rob

Reply via email to