External C/C++ user-defined functions must have the following restrictions.
All UDFs should be written in a manner that allows the functions to be called simultaneously by different users while receiving different context functions.
If a UDF accesses a global or shared data structure, the UDF definition is responsible for implementing the appropriate locking around its accesses to that data including the releasing of that locking under all normal code paths and all error handling situations.
UDFs implemented in C++ may provide overloaded "new" operators for their classes, but they should never overload the global "new" operator. On some platforms the effect of doing so is not limited to the code defined within that specific library.
All aggregate UDFs and all deterministic scalar UDFs should be written such that the receipt of the same input values will always produce the same output values. Any scalar function for which this is not true must be declared as NONDETERMINISTIC to avoid the potential for incorrect answers.