[PATCH v2] eal: fix thread race in control thread creation
David Marchand
david.marchand at redhat.com
Tue Mar 7 14:53:34 CET 2023
On Thu, Mar 2, 2023 at 5:18 AM Honnappa Nagarahalli
<Honnappa.Nagarahalli at arm.com> wrote:
> > > > if (ctrl_thread_init(arg) != 0)
> > > > return NULL;
> > > >
> > > > - return start_routine(params->arg);
> > > > + return start_routine(start_arg);
> > > We can free 'params' here after 'start_routine' returns.
> >
> > I guess it doesn't matter if the allocation is retained for the duration of
> > start_routine() which could be ~long.
> Yes, that's what I thought, it is a small size.
>
> >
> > David/Honnappah let me know what you decide. if you'd prefer to change to
> > honnappah's suggestion i'll put a new version up.
Hum, how would it look like?
- the parent thread would free params if the child thread fails to set affinity,
- the child thread would free params otherwise,
Is this what you propose?
This works, but we have to be extra careful if any change is done in
this part later.
--
David Marchand
More information about the dev
mailing list