[dpdk-dev] Retrieving lcore worker thread id
Honnappa Nagarahalli
Honnappa.Nagarahalli at arm.com
Tue Jul 14 20:59:59 CEST 2020
<snip>
> >
> > Hi.
>
> Hey,
>
> > In DPDK 19.11, the lcore_config struct of <rte_lcore.h> is made
> > private, and with it the possibility to look up the thread id of the
> > lcore worker threads disappears.
> >
> > One use case is an application with a monitoring function (on some
> > control plane thread), which uses the thread ids to make sure the
> > worker threads gets the CPU runtime they should, and thus is able to
> > detect stalls.
This sounds similar to 'keep alive' functionality.
> >
> > Is there some other way of finding out the thread_id of a lcore worker
> > thread? All I can think of are hacks like using a temporary service
> > function for service cores, in combination with requiring launched
> > application threads also to store their thread id in some global
> > structure (index by lcore_id).
>
> -1 for the service cores idea. I like the creative solution thinking, but not as a
> long-term solution.
>
> > Is there some cleaner way? If not, would adding something like a
> > rte_lcore_thread_id() function make sense?
I guess here you mean the OS provided thread ID. Are there OS calls that provide the CPU runtime?
>
> I think given your use-case description above, this makes sense.
> I guess it comes down to a discussion around if thread_id should be exposed
> at all - but given you have a use I'd argue yes it should.
> Doing so in a cross-platform way might be a bit tricky though.
>
> > Regards,
> > Mattias
>
> Regards, -Harry
More information about the dev
mailing list