Page 1 of 1
Multithreads
Posted: Wed Jul 30, 2003 6:19 pm
by azteck
HI.I have a script that conects to some webpages and extract some data from there.But it takes too long to receive data.So I was wondering if is possible to have something like a multithreas system in php.It is only one script, and ca't use tmporary files or databases.
Posted: Wed Jul 30, 2003 7:49 pm
by m3mn0n
Optimizing the code for speed is your best bet.
Posted: Wed Jul 30, 2003 10:10 pm
by trollll
Aw, shucks. I had hoped someone had written something more like,"Well, they haven't really documented it, but you can multithread by following this pattern:..."
Sigh...
I guess our only hope for multithreading lies in the hands of those who contribute to the PHP/Java integration.
Posted: Wed Jul 30, 2003 10:31 pm
by Stoker
simple caching of the other site(s) or periodic snapshots created by a cron job...
Threading and forking is a bit more advanced that what PHP can do (AFAIK), you could make some executables (CGI interfaced) for that..
Posted: Thu Jul 31, 2003 2:29 am
by m3mn0n
That could work also. But it's a very complicated task.

Posted: Thu Jul 31, 2003 1:24 pm
by azteck
Thank you all:)
I made something like this for other script that needed speed:
I had the links that must be checked in a database.Then I used soemthing like a Fork systemMy php script autoexecuted himself, so i could run let's say about 10 threadds.But It was a strange approach

so i forget about it.