On Mon, 03 Nov 2014 14:09:02 +0200 Taras Kondratiuk 
<taras.kondrat...@linaro.org> wrote:
> Won't it be simpler to add a new local initialization API in your
> library instead of piggy-backing on ODP local init call?
> 
> Something like:
> stl_odp_local_init()
> {
>       odp_local_init();
>       stl_local_init(); /* Here your lib local init is done */
> }

That would be one approach, yes.

But IMO it has some disadvantages over registering a hook into
'odp_init_local':

1. Users must call 'stl_odp_local_init' upon program init (and not
  odp_init_local).

2. 'odp_init_local' is currently invoked automatically from the thread
  created by 'odph_linux_pthread_create()'.
  (See odp_run_start_routine, which first calls 'odp_init_local' and only
  then calls the user's start_routine).

  Meaning, following the 'stl_odp_local_init' paradigm, I would also
  need to expose a 'stl_odph_linux_pthread_create()' that properly
  invokes 'stl_odp_local_init' automatically, too.

Combine these two, and let's even imagine there's more than one "entity"
that requires per-thread initialization - following the
'stl_odp_local_init' approach might get messy.

Regards,
Shmulik

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to