PHP multi-thread extension development solution

Source: Internet
Author: User
Tags imagemagick
I want to develop PHP multi-threaded extensions myself and I want to develop php multi-threaded Extensions. However, I found that the same method of calling the php user class through multiple threads, but when two methods call the same method of a class instance at the same time, a memory error will be reported. Group: 95303036, technical group welcome to discuss. does PHP support multithreading ??? It seems not supported !, 1. multi-thread PHP extension development in linux
I want to develop php multi-thread extension,

However, it is found that the method for calling php user classes through multiple threads will report a memory error when two methods call the same method of a class instance at the same time.

Group: 95303036, technical group Welcome to discussion

------ Solution --------------------
Does PHP support multithreading ???
It seems not supported!
------ Solution --------------------
1. php multi-thread extension already exists in linux. you can refer to his source code
2. to use multithreading in php, the core php System and the extensions involved must be thread-safe.
------ Solution --------------------
I am referring to the pcntl extension
------ Solution --------------------
Pcntl is a process.

Pecl is the thread, but it has not been updated for a long time.

I don't know what motivation you want to develop. I don't feel necessary,
For more information, see here:
Https://bugs.php.net/bug.php? Id = 47894
------ Solution --------------------
ImageMagick can refer to http://fkblog.sinaapp.com/imagemagick-cn
------ Solution --------------------
Ke, too advanced... contact laruence
Http://www.laruence.com/

Discussion

Upstairs does not ask

Reference:
Pcntl is a process.

Pecl is the thread, but it has not been updated for a long time.

I don't know what motivation you want to develop. I don't feel necessary,
For more information, see here:
Https://bugs.php.net/bug.php? Id = 47894

The reason is that we use php for webgame, because the company wants to do webgame for socket communication, but p ......

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.