Home  >  Article  >  Backend Development  >  05-Multiple processes? SAPI life cycle of threads

05-Multiple processes? SAPI life cycle of threads

WBOY
WBOYOriginal
2016-07-29 08:52:17992browse

Multi-process SAPI life cycle

Usually PHP is compiled as a module of apache to handle PHP requests. Apache generally adopts multi-process mode. After Apache is started, it will fork multiple child processes. Each process has an independent memory space. Each child process will go through the start and end stages. However, the beginning stage of each process only occurs after the process forks. To proceed, multiple requests may be processed throughout the lifetime of the process. The shutdown phase occurs only after Apache is shut down or the process is terminated. In between these two phases, the request start-request shutdown phase is repeated with each request.


05-Multiple processes? SAPI life cycle of threads


Multi-process SAPI life cycle

Multi-threaded SAPI life cycle

Multi-thread mode is similar to a process in multi-process. The difference is that the request start-request closure will be repeated in parallel throughout the life cycle of the process. link.


05-Multiple processes? SAPI life cycle of threads

Multi-threaded SAPI life cycle
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced the SAPI life cycle of 05-Multi-process? Threads, including life cycle and api aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn