[PATCH v4 2/2] eal: fix failure path race setting new thread affinity

Tyler Retzlaff roretzla at linux.microsoft.com
Wed Mar 15 02:26:46 CET 2023


On Tue, Mar 14, 2023 at 06:20:42PM -0700, Stephen Hemminger wrote:
> On Tue, 14 Mar 2023 15:50:39 -0700
> Tyler Retzlaff <roretzla at linux.microsoft.com> wrote:
> 
> > +	/* Wait for the thread wrapper to initialize thread successfully */
> > +	while ((thread_wrapper_status =
> > +		__atomic_load_n(&ctx->thread_wrapper_status,
> > +		__ATOMIC_ACQUIRE)) == THREAD_WRAPPER_LAUNCHING)
> > +		sched_yield();
> 
> Using pthread condition variable would be better, and avoid
> using sched_yield() which is deprecated and not guaranteed to
> work in cases where threads have different priority.

seems reasonable since this code is platform dependent, i'll spin a new
patch with a condvar then.

thanks for the suggestion.


More information about the stable mailing list