When Mysql chose to kill a Process(automatically)
MySQL can kill a connection if it exceeds wait_timeout.  (Caution, there are various wait timeout settings.)
InnoDB can kill a transaction in the case of a &quot;deadlock&quot;.  One of the competing transactions is killed, the other(s) are allowed to continue.
InnoDB can kill a query if it is waiting too long for a lock.  See innodb_lock_wait_timeout, which defaults to 50 seconds.
A user can &quot;kill&quot; a mysql process via the commandline tool 'mysql' and it's kill command.
I don't think there is anything special about Stored Procedures, Functions, Events, Triggers -- they are essentially collections of queries that are, in turn, subject to the comments above.
UDFs contain code written by users and specially installed.  These can do anything nasty that you like.
There are essentially no &quot;priorities&quot; that you can control.  It is better to let MySQL decide what to do when.
Do you mean something else by &quot;process&quot;?