Why PHP developers can't provide setlocale function as per thread scope

寵の児 提交于 2019-12-06 10:06:12

You already provided the answer:

The locale information is maintained per process, not per thread. [...]

It's not a PHP problem, that's just how locale settings work. Changing it applies to the whole running process. It's a system setting that doesn't know about your application-internal threading.

Now it appears since Windows handles both the locale and the threading via system calls, it can accomplish the unthinkable task: apply the locale settings per thread.
Here's a reference: http://msdn.microsoft.com/en-us/library/ms235302(v=vs.80).aspx

So if you run on a system which is specifically prepared for that, you don't need to care. For portability of your applications you still should keep it in mind. (Albeit the Apache threading MPM isn't used that widely I believe.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!