Matlab Mex library lifecycle

Viewed 1652

Does anyone know what the matlab mex library lifecycle is? Specifically I am interested in the following:

  1. Is there a way to force the library to be loaded before invoking it?
  2. Is the library a singleton or are multiple instances loaded?
  3. Are there any hooks for initialization prior to invocation?
  4. Is there a destructor hook/signal that can be intercepted when the library is unloaded for cleanup?

I did an extensive search here and online and I could not find the answers to these questions. My problem has some performance cost with initialization and I would like to avoid that if possible, without needing to write a service.

2 Answers
Related