A database management system provides for the execution of invokable user-defined
routines. Applications specify user-defined routines as being threadsafe or not
threadsafe and specify the language of user-defined routines. Execution of routines
will be carried out dependent on the threadsafe characteristic of the routines
and on the language of the routines. Routines are assigned to processes based on
their language to have any given process execute routines of the same language.
Routines that are specified to be threadsafe are executed in threads in a potentially
multi-threaded process. Each routine that is specified to be not threadsafe is
executed in a fenced-mode processes in which no other routine is being executed.