Multithreading in PHP

前端 未结 6 557
有刺的猬
有刺的猬 2020-12-06 07:27

I recently read about http://php.net/pcntl and was woundering how good that functions works and if it would be smart to use multithreading in PHP since it isn\'t a core func

6条回答
  •  温柔的废话
    2020-12-06 08:10

    This is not thread control, this is process control. The library for the threads is pthreads (POSIX threads) and it's not included in PHP, so there are no multi-threading functions in PHP.

    As of multiprocessing, you cannot use that in mod_php, as that would be a giant security hole (spawned process would have all the web-server's privileges).

提交回复
热议问题