pthreads-php What does thread safety mean?

Source: Internet
Author: User
Tags zts
PHP has such an option when compiling the installation--enable-maintainer-zts English explanation is enable thread Safety-for code maintainers only!!
Abstract understanding thread safety for code maintenance personnel!
So what does that mean?
and add the threading module in php5.3 pthreads must be PHP at compile time to turn on this option

Reply content:

PHP has such an option when compiling the installation--enable-maintainer-zts English explanation is enable thread Safety-for code maintainers only!!
Abstract understanding thread safety for code maintenance personnel!
So what does that mean?
and add the threading module in php5.3 pthreads must be PHP at compile time to turn on this option

Thread-Safe Explanation:
From the PHP5.2.10 version, there are none-thread safe and Thread safe two versions of the choice, what is the difference between the two versions, as a user should be how to choose? The following friends will tell you.

First of all, in the literal sense, none-thread safe is non-thread-safe, do not thread security at execution time, thread safe is threaded, thread security is performed, to prevent new requirements to start a new thread of CGI The execution method exhausts the system resources.

Let's look at two ways of executing PHP: ISAPI and fastcgi. FastCGI execution is performed in a single thread, so there is no need for thread security checks, and removing thread security checks can improve execution efficiency, so if PHP is executed in FastCGI (whether with IIS 6 or IIS 7), it is recommended to download, execute Non-thread Safe php (php Two files are packaged in two ways: MSI, zip, download the zip kit). Thread safety checks are prepared for the ISAPI way of PHP, because there are many PHP modules that are not thread-safe, so you need to use the thread safe PHP.

Talk about your questions, first of all this is related to multithreading, if you want to use multithreading (PHP, such as: pthreads), then this parameter is necessary.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.