Thanks Dave !
I could figure out the vm->worker_thread_main_loop_callback with your hint.
It seems to be a newer feature, but looks to be quite easily back
portable to older releases as well -- introduce the field and call it
from the main loop.

So I could setup a piece of memory as the request message and reply
message, set the request message in my main thread, point the callback
of vm[i] to the desired function to be called in the worker, the
worker does what it has to do and sets up the reply message and nulls
out the callback, the main thread can poll for the reply to arrive
with a field there and voila !

Many thanks for adding this feature !

Regards
-Prashant


On Sun, Nov 11, 2018 at 6:46 PM Dave Barach (dbarach) <dbar...@cisco.com> wrote:
>
> Check out src/plugins/perfmon/perfmon_periodic.c for one take on that 
> problem...
>
> Dave
>
> -----Original Message-----
> From: vpp-dev@lists.fd.io <vpp-dev@lists.fd.io> On Behalf Of Prashant 
> Upadhyaya
> Sent: Sunday, November 11, 2018 2:37 AM
> To: vpp-dev@lists.fd.io
> Subject: [vpp-dev] Regarding communication from main thread to worker threads
>
> Hi,
>
> The function, vl_api_rpc_call_main_thread, is useful to do message transfer 
> from worker thread to the main thread.
>
> Is there any mechanism where I can call a function in worker thread from the 
> main thread ? That is, just the reverse of the above.
>
> I can use interrupts (vlib_node_set_interrupt_pending) but I can't send any 
> data with the interrupt I suppose.
>
> So basically I want to find out if there is any infra available where I can 
> send some data to my worker thread from the main thread instead of creating a 
> frame of data and enqueueing it the normal way to the worker towards a node.
>
> Regards
> -Prashant
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#11196): https://lists.fd.io/g/vpp-dev/message/11196
Mute This Topic: https://lists.fd.io/mt/28079125/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to