You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by James liu <li...@gmail.com> on 2007/04/27 04:12:03 UTC

Question to php to do with multi index

php not support multi thread,,,and how can u solve with multi index in
parallel?

now i use curl_multi

maybe more effect way i don't know,,,so if u know, tell me. thks.


-- 
regards
jl

Re: Question to php to do with multi index

Posted by James liu <li...@gmail.com>.
i think curl_multi is slow.

thks, i will try.

2007/4/27, Michael Kimsal <mg...@gmail.com>:
>
> The curl_multi is probably the most effective way, using straight PHP.
> Another option would be to spawn several jobs, assuming unix/linux, and
> wait
> for them to get done.  It doesn't give you very good error handling (well,
> none at all actually!) but would let you run multiple indexing jobs at
> once.
>
> Visit http://us.php.net/shell_exec and look at the 'class exec'
> contributed
> note about halfway down the page.  It'll give you an idea of how to easily
> spawn multiple jobs.
>
> If you're using PHP5, the proc_open function may be another way to go.
> proc_open was available in 4, but there were a number of extra parameters
> and controls made available in 5.
> http://us.php.net/manual/en/function.proc-open.php
>
> An adventurous soul could combine the two concepts in to one class to
> manage
> pipes communication between multiple child processes effectively.
>
> On 4/26/07, James liu <li...@gmail.com> wrote:
> >
> > php not support multi thread,,,and how can u solve with multi index in
> > parallel?
> >
> > now i use curl_multi
> >
> > maybe more effect way i don't know,,,so if u know, tell me. thks.
> >
> >
> > --
> > regards
> > jl
> >
>
>
>
> --
> Michael Kimsal
> http://webdevradio.com
>



-- 
regards
jl

Re: Question to php to do with multi index

Posted by Michael Kimsal <mg...@gmail.com>.
The curl_multi is probably the most effective way, using straight PHP.
Another option would be to spawn several jobs, assuming unix/linux, and wait
for them to get done.  It doesn't give you very good error handling (well,
none at all actually!) but would let you run multiple indexing jobs at once.

Visit http://us.php.net/shell_exec and look at the 'class exec' contributed
note about halfway down the page.  It'll give you an idea of how to easily
spawn multiple jobs.

If you're using PHP5, the proc_open function may be another way to go.
proc_open was available in 4, but there were a number of extra parameters
and controls made available in 5.
http://us.php.net/manual/en/function.proc-open.php

An adventurous soul could combine the two concepts in to one class to manage
pipes communication between multiple child processes effectively.

On 4/26/07, James liu <li...@gmail.com> wrote:
>
> php not support multi thread,,,and how can u solve with multi index in
> parallel?
>
> now i use curl_multi
>
> maybe more effect way i don't know,,,so if u know, tell me. thks.
>
>
> --
> regards
> jl
>



-- 
Michael Kimsal
http://webdevradio.com