[riot-devel] To global seed or not to global seed
oliver.hahm at inria.fr
Wed Mar 8 10:21:15 CET 2017
thanks for bringing up this discussion.
On Wed, Mar 08, 2017 at 12:18:28AM +0100, Cenk Gündoğan wrote:
> 1) we can define it as BCP to *not* use `random_init()` if `auto_init`
> is used
> => it's hard to guarantee a one-time call to `random_init()` as human
> do surely err (especially if several nested modules are involved).
Basically, we have similar problems for other modules that should (or even
must) not be initialized twice. So far, my/our take on this was to document
this rather than programmatically prevent this. The memory overhead is small,
but existent, the runtime overhead is probably negligible for a function that
should not be called more than once.
> In contrast to the current procedure of having a global state, we rather
> should opt to allow local states for each thread (not excluding a global
Is testing and simulation the only use case you can imagine? I'm somewhat
reluctant to add code just for non-production purposes.
/* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
* Wirzenius wrote this portably, Torvalds fucked it up :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the devel