Hi. Need some advice. I have to load a library during R_init_XXXXX() with dlopen(). The library file is 23 megabytes long and loads several other libraries. Everything happens during dlopen() execution, out of control, and takes around 1 second on first load in a quadcore. Besides, due to security reasons, a hash of the library file is going to be computed. Still do not know how long it will take.
Questions. Is 1 second acceptable for R? Slower machines may take a lot longer to return from R_init_XXXXX(). Does R_init_XXXXX() have to return soon or call R_CheckUserInterrupt()? Or is it somehow free from this R need? Is it safe to load the second library and compute the hash within other threads so R_init_XXXXX goes on? If some function of my extension library is called it can call R_CheckUserInterrupt() if and while the threads do not end. If such use of threads is safe inside R, is there a package that does it? Any tips? Flags currently sent to dlopen are (RTLD_LAZY | RTLD_LOCAL). Revolving the R sources could not find the flags R uses. Does any of you know for sure the flags used to load extensions with loadLibrary()? Looking into computeDLOpenFlag() did not answer the question. Is there a recommended flags set in this situation? Aparently dlopen() flags LM_ID_BASE and RTLD_GROUP (their use sounds wise) are not defined in Linux. Is this correct or I missed something? Thanks. -- Alexandre -- Alexandre Santos Aguiar, MD, SCT
signature.asc
Description: This is a digitally signed message part.
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.