Quoting Andrey Mazo ([email protected]):
> Since lxc_global_config_value() tries to cache return value (exactly in 
> "values" array) to avoid rereading config file multiple times for the same 
> option, we can't just allocate "values" array on stack.
> Also, it would require all callers to free() returned memory.
> ifdef approach should work though.
> 
> But we can also go another way: instead of parsing config file 
> LXC_GLOBAL_CONF on demand (and reading through it multiple times),
> we can parse it once upon startup (before becoming multithreaded) thus 
> eliminating the need for __thread or locking and still keeping "values" array 
> static.
> Or am I missing something?

That might work.  THe values may be overriden by argument passing, but
that again is done in all lxc_* programs before becoming mulitthreaded.

-serge
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to