R – Dlls unloading order in Unix and Windows

dllshared-libraries

I have 2 dlls: A and B.

From a code in dll A, I am loading dynamically the dll B (using dlopen on Unix and LoadLibrary on Windows). Is it guaranteed that B will be unloaded before A?

Is there any difference between Unix and Windows behavior?

Best Answer

There is no guarantee as to which DLL will be unloaded first (Unix and WIndows do not differ on this point).