How do you make good use of multicore CPUs in your PHP/MySQL applications?

后端 未结 5 1845
春和景丽
春和景丽 2020-12-02 07:51

I maintain a custom built CMS-like application.

Whenever a document is submitted, several tasks are performed that can be roughly grouped into the following categori

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 08:03

    Just letting you guys know when you think: "poor PHP does not have multithreading"

    Well... Python doesn't have real multithreading either. Nor does NodeJS have multi-threading support. Java has some sort of multithreading, but even there, some code halts the whole machine afaik.

    But: unless you do heavy programming of one single thing, it's irrelevant. Many requests hit your page and all your cores will be used none the less as each request spawns its own process with its own single thread.

提交回复
热议问题