Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
1696 Discussions

Help required to Multithread the product developed on Php

PRAVEEN_R_Intel
Employee
666 Views
Hi!,

We are developing a campus ERP solution that runs on the LAMP platform using Intel processors. I would like to know how you can help us in speeding up this application by helping us to make use of the Intel multi-core architecture. Our application typically runs on a quad core processor machine. A couple of ways I can think of and for which I would request more information from you are

1) How can we write multi-threaded code in PHP , maybe by using any third part tools or any special Intel tools that let you do this.

2) Help us in configuring the Linux installation to make use of the multi-core processor and then use Intel tools to monitor the benefits.

Please do the needful at the earliest.

Cheers!
Praveen
0 Kudos
5 Replies
ClayB
New Contributor I
666 Views
Praveen -

While I'll be the first to admit I don't know everything (with my wife a close second :-), I don't really know if scripting languages are able to do any native concurrency. I think Python may have something that allows concurrent execution, but that's mostly just an unsubstantiated rumor AFAIK. You could run multiple scripts at the same time and each should get a different core, I suppose.

In that same vein, I don't know of any tools, Intel or otherwise, that can help with threading PHP. The Intel tools that I'm aware of have been focused on C/C++ threading. The upcoming Parallel Studio will integrate with Visual Studio to assist in parallelizing C++ code.

I'm sorry that I can't help you more than this. I hope that anyone with better knowledge on this topic will post to lend their assistance and to correct any misstatements that I've made.

--clay

0 Kudos
Dmitry_Vyukov
Valued Contributor I
666 Views
Hi!,

We are developing a campus ERP solution that runs on the LAMP platform using Intel processors. I would like to know how you can help us in speeding up this application by helping us to make use of the Intel multi-core architecture. Our application typically runs on a quad core processor machine. A couple of ways I can think of and for which I would request more information from you are


Once again, isn't PHP code automatically "parallelized" by Apache with the "thread per request" approach? I think that it is enough for most web code.

0 Kudos
Dmitry_Vyukov
Valued Contributor I
666 Views
Hi!,

We are developing a campus ERP solution that runs on the LAMP platform using Intel processors. I would like to know how you can help us in speeding up this application by helping us to make use of the Intel multi-core architecture. Our application typically runs on a quad core processor machine. A couple of ways I can think of and for which I would request more information from you are

1) How can we write multi-threaded code in PHP , maybe by using any third part tools or any special Intel tools that let you do this.

2) Help us in configuring the Linux installation to make use of the multi-core processor and then use Intel tools to monitor the benefits.



For parallelization of PHP code you can use multiple processes, shared memory, semaphores and message queues:
http://www.php.net/manual/en/book.sem.php
http://www.php.net/manual/en/book.exec.php
However probably PHP is not the best language for that...
0 Kudos
Dmitry_Vyukov
Valued Contributor I
666 Views
Here is an example of creation of "threads" in PHP and communication between them via message passing:
http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html
0 Kudos
infocom-solutions
666 Views
Quoting - Dmitriy Vyukov
Here is an example of creation of "threads" in PHP and communication between them via message passing:
http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html

Thank You Very Much.
0 Kudos
Reply