rlm_perl and threads

Edgar Fuß ef at math.uni-bonn.de
Wed Nov 14 15:47:03 CET 2012


Thanks, this has been very helpful.

If I read the source correctly, it works as follows:
-- A "global" interpreter is created that runs the module initialization code.
-- When a perl function is going to be called, the global interpreter is used in the non-threading case. In the threading case, if necessary, a thread-local interpreter is created by cloning the global one.
So, in the non-threading case, I would have to perform initialization tasks like opening a database connection in the module init code. In the threading case, I have do to that in CLONE().
In the module init code, can I tell whether I'm in the threading case or not? It's probaby no harm besides a waste of resources to also do the full init there in the threading case, but I would like to avoid that if easily possible.

> Threading is not done in debug mode (-X), start your freeradius in normal mode to test multithreading.
I think this should be documented since one is always urged to test in debug mode.


More information about the Freeradius-Users mailing list