[dpdk-dev] [PATCH v5] eal: add generic thread-local-storage functions

Tal Shnaiderman talshn at nvidia.com
Wed Dec 30 11:04:28 CET 2020


> Subject: Re: [PATCH v5] eal: add generic thread-local-storage functions
> 
> External email: Use caution opening links or attachments
> 
> 
> On Sat, 26 Dec 2020 18:08:48 +0200, Tal Shnaiderman wrote:
> > diff --git a/lib/librte_eal/windows/meson.build
> > b/lib/librte_eal/windows/meson.build
> > index 3b2faf29eb..f4c3e2f12c 100644
> > --- a/lib/librte_eal/windows/meson.build
> > +++ b/lib/librte_eal/windows/meson.build
> > @@ -21,4 +21,10 @@ sources += files(
> >       'getopt.c',
> >  )
> >
> > +if (dpdk_conf.has('use_windows_pthread'))
> > +     sources += 'librte_eal/common/rte_thread.c'
> > +else
> > +     sources += 'librte_eal/windows/rte_thread.c'
> > +endif
> > +
> 
> You need get_option(), not dpdk_conf (apologies again for not being precise
> when I drafted the approach):
> 
> --- a/lib/librte_eal/windows/meson.build
> +++ b/lib/librte_eal/windows/meson.build
> @@ -21,7 +21,7 @@ sources += files(
>         'getopt.c',
>  )
> 
> -if (dpdk_conf.has('use_windows_pthread'))
> +if get_option('use_windows_pthread')
>         sources += 'librte_eal/common/rte_thread.c'
>  else
>         sources += 'librte_eal/windows/rte_thread.c'
> 
> Worse, with -Duse_windows_pthread=true file in common directory
> includes <pthread.h>, but it finds pthread shim from windows subdirectory,
> not the file from external library or MinGW toolchain. So the option is not
> usable until the shim exists. I suggest removing the option for now, let's
> reintroduce it when rte_thread.h grows and the shim goes away.
> 

Right, thanks for checking, I'll send a version without it.

I was planning to add support for thread priority control to address the issue of threads with realtime priority denying cpu time from OS threads, I think it will be a good opportunity to move pthread_create to the new API.


More information about the dev mailing list