Jeff Squyres, le Fri 18 Feb 2011 16:55:47 +0100, a écrit :
> Let's do pthread_once() -- we don't have any of the infrastructure mojo for memory barriers.
> What will we need on Windows?
It can easily be implemented with named mutexes on windows.
> Are there other OS's without pthread_once()?
It depends how far you look it the past. pthread_once was added to posix
in issue 5 (1998).
> >> Is there no portable way to define a library _init function?
> > Not even in C99.
> Where should this functionality be, if we can't put it in an _init function, and it doesn't belong in the topology init function?
It would be a library initialization function that the programmer needs
to call. The topology init function is the best that can be done without
going that way.