On Fri, Sep 11, 2015 at 7:55 AM, Petri Savolainen < [email protected]> wrote:
> Added max number of worker/control threads as global init > parameters. Implementation can e.g. optimize it's per worker > thread resource reservation or configuration accordingly. > > Maximum values are platform specific. These values come > typically from the user as command line arguments, etc. > > Signed-off-by: Petri Savolainen <[email protected]> > --- > include/odp/api/init.h | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/include/odp/api/init.h b/include/odp/api/init.h > index 0683d8d..d327305 100644 > --- a/include/odp/api/init.h > +++ b/include/odp/api/init.h > @@ -110,8 +110,16 @@ typedef void (*odp_abort_func_t)(void) ODP_NORETURN; > * @note It is expected that all unassigned members are zero > */ > typedef struct odp_init_t { > - odp_log_func_t log_fn; /**< Replacement for the default log fn */ > - odp_abort_func_t abort_fn; /**< Replacement for the default abort > fn */ > + /** Maximum number of worker threads the user will run > concurrently. > + Valid range is from 0 to platform specific maximum. */ > + int num_worker; > + /** Maximum number of control threads the user will run > concurrently. > + Valid range is from 0 to platform specific maximum. */ > + int num_control; > + /** Replacement for the default log fn */ > + odp_log_func_t log_fn; > + /** Replacement for the default abort fn */ > + odp_abort_func_t abort_fn; > } odp_init_t; > > Why not add the new parameters at the end of the struct? That way we're at least making an attempt at backwards compatibility (something we need to be thinking about going forward). I'd also have the convention that if either num_worker or num_control are 0 this means application is providing no hints and implementation defaults should apply for these values. That way when odp_init_init() is called to initialize this struct (which also should be added) we're future-proofed. > /** > @@ -133,9 +141,10 @@ typedef struct odp_platform_init_t { > * functions. > * > * @param params Those parameters that are interpreted by the > ODP API. > + * Use NULL to set all parameters to their > defaults. > * @param platform_params Those parameters that are passed without > * interpretation by the ODP API to the > implementation. > - * > + * Use NULL to set all parameters to their > defaults. > * @retval 0 on success > * @retval <0 on failure > * > -- > 2.5.1 > > _______________________________________________ > lng-odp mailing list > [email protected] > https://lists.linaro.org/mailman/listinfo/lng-odp >
_______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
