How modules are called during request processing phase

Hi All,

If I have two modules mod_A and mod_B. Both has defined a hook handler with
APR_HOOK_MIDDLE then which module will be called first to check handler.
Whether calling of module will be random for each request or it depends
which module is loaded first in httpd.conf.