Possible Duplicate:
What is thread safe or non thread safe in PHP
What does it mean when something is or is not thread safe?
For example, setlocale() in PHP is not thread safe:
The locale information is maintained per process, not per thread. If you are running PHP on a multithreaded server API like IIS or Apache on Windows, you may experience sudden changes in locale settings while a script is running, though the script itself never called setlocale(). This happens due to other scripts running in different threads of the same process at the same time, changing the process-wide locale using setlocale().
http://php.net/manual/en/function.setlocale.php
What does this practically mean? Is it a good thing that something is thread safe or not?
Under what conditions do you need a thread-safe or non-thread-safe solution to your problems?
Thread safe is a good thing, it means whilst there may be multiple concurrent threads, they are talking to each other in a safe way that won't have race conditions, concurrency issues, etc.
Thread safety is a computer programming concept applicable in the context of multi-threaded programs. A piece of code is thread-safe if it only manipulates shared data structures in a thread-safe manner, which enables safe execution by multiple threads at the same time. There are various strategies for making thread-safe data structures.
Source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With