I've found erl_interface / ei library to be not thread safe.
This has been directly noticed in erl_format(), erl_match() behaviour,
also I did manage to make my port program stable only when all
erl_interface/ei calls from multiple threads were protected by mutex
For some reason this fact is not documented. Should be clearly
mentioned in the documentation until fixed.
My OTP version R11B-5, but same problem I'm sure still exists in R12B-*
erl_interface compiled for thread support:
# Have the ei and erl_interface libs been compiled for threads?