When a modual updates a glogally shared resource (other than one with its own protection, such as
SQL database, or another server we are merely proxying), we need to use the APR global mutex to protect
critical sections of code.
The APR global mutex is more complex and more expensive than the thread mutex. The complexity lies
in the initial setup of the mutex. First, it must be created in the parent process in the pose_config
phase. Second, each child has to attach to it in the child_init phase.
SQL database, or another server we are merely proxying), we need to use the APR global mutex to protect
critical sections of code.
The APR global mutex is more complex and more expensive than the thread mutex. The complexity lies
in the initial setup of the mutex. First, it must be created in the parent process in the pose_config
phase. Second, each child has to attach to it in the child_init phase.
当模块更新全局共享资源时,除了使用自身保护机制(如SQL数据库或其他服务器代理),还需要采用APR全局互斥来保护代码中的关键区域。APR全局互斥比线程互斥更复杂且成本更高,其复杂性主要体现在初始设置阶段,包括在父进程中创建互斥,并在子进程初始化阶段进行绑定。
813

被折叠的 条评论
为什么被折叠?



