Hi,

I have a pool per worker (created with pool_init_fixed). Workers allocate from 
their own pool with pool_get().

I also have a separate thread created via vlib_register_thread(). It is not 
part of the graph and does not receive packets. This thread processes data and 
needs to return objects to each worker’s pool.

Right now, this thread directly calls pool_put(pool, pool[index]) on the 
worker’s pool.

Questions:

1. Is pool_put() safe to call from another thread, or can this cause race 
conditions because clib pools are not thread-safe?

2. A possible solution is to use a small per-worker ring: the extra thread 
enqueues freed indices, and the worker dequeues and calls pool_put() locally. 
Is this a recommended pattern in VPP for zero-copy ownership transfer between 
threads?

3. Any better approach for this scenario?

Thanks!
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#26614): https://lists.fd.io/g/vpp-dev/message/26614
Mute This Topic: https://lists.fd.io/mt/116648538/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/14379924/21656/631435203/xyzzy 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to