Hi,

> If a new thread is created through pthread_create in the vpp main thread,can 
> the function vlib_buffer_alloc be used in this new thread.
> Is the function vlib_buffer_alloc thread-safe? If it doesn't work, how should 
> I invoke it.

vlib_buffer_alloc() is thread-safe, but not from arbitrary pthread_create()-ed 
threads. You should use VLIB_REGISTER_THREAD(), or delegate allocations to the 
main thread via vlib_rpc_call_main_thread().

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

Reply via email to