ofiwg/libfabric — pull request #297 by jsquyres (2014-11-08 15:48:22+00:00)
Title: Add support for static constructors

THIS IS A PROOF OF CONCEPT AND NOT YET COMPLETE. It is intended as a convenient way to review some concept code that is part of the discussion of #293.

The idea is that configure builds up a list of providers that are statically included in libfabric. It writes out tables of the provider constructors and destructors in include/rdma/fi_static_providers.h. This file is included in src/fabric.c. The first time fi_getinfo() is called, it walks the table of constructors and invokes them.

Still to do:

* Need to make it safe for multiple threads to call fi_getinfo() simultaneously: the "first" check needs to be safe, and none of the callers should be able to return until all the constructors have been called (i.e., probably need a mutex).
* Don't know what to do with the destructors yet.