我现在做一个网站后台系统,一个学 Java 的老司机告诉我,email 发送很耗时,因此要多开一个线程。 但奈何我一点都不懂多线程和多进程。
所以请老司机能否推荐一下这方面资料?
另外,我在看 pthreads 时,发现一个非常困惑的地方:
我看了一个 github 的 repo,https://github.com/krakjoe/pthreads 它的网站上有这么一句话: http://pthreads.org/ It includes all the tools you need to create multi-threaded applications targeted at the Web or the Console.
但在 PHP 官网上,http://docs.php.net/manual/en/book.pthreads.php 有这么一段话: Warning The pthreads extension cannot be used in a web server environment. Threading in PHP should therefore remain to CLI-based applications only.
所以我到底能不能用于 web 开发呢?
如果 问了一个蠢问题,请多多海涵,我对多进程和多线程真的没概念。