You are here: Re: [PHP] Question about apache-php concurrent process control « PHP « IT news, forums, messages
Re: [PHP] Question about apache-php concurrent process control

Posted by Rasmus Lerdorf on 10/21/73 11:21

Liang ZHONG wrote:
> As I know, apache-php works this way. When the web server gets an http
> request with file name extension ".php", it will start the php
> interpreter to process the php file.
>
> Now I have a php program does something like this: when it is executing
> with one parameter p1, the program code goes to contact a database, gets
> back huge amount of data, writes it to file system. This will take
> pretty long time to finish. In the mean time, the same php code will be
> invoked by apache with another request, passing different parameter p2,
> indicates the code need to run to check the availability and read
> partial of the data which has already writen to the file system just
> now. The program location need to be in the same URL, but with only
> different parameter passing to it.
>
> for example:
>
> http://baseURL/a.php?v=p1
> http://baseURL/a.php?v=p2
>
> I want these 2 process can be run concurrently, but through a small
> test, I found out that they just sequentially execute one after the other.

Sorry, your test is wrong then. Apache/PHP does not serialize requests
like that. If somehow the backend you are collecting data from is
serializing the requests, then you are out of luck and frontend threads
isn't going to solve that since your threads would simply be serialized
as well. You are on the wrong track here.

-Rasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация