1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

PHP Multithreading

Discussion in 'PHP & Perl' started by Stalli0n, Mar 26, 2011.

  1. Stalli0n

    Stalli0n Junior Member

    Joined:
    Nov 17, 2010
    Messages:
    115
    Likes Received:
    83
    Location:
    Europe
    Hey, want to make an account creator using CURL, but i don't know how to implement multithreading.

    Should i just run the script multiple times?

    I need an automated solution, so i can put up to 1k into a queue and php will work them off with multiple threads and automatically start a new one when a thread is finished.
     
  2. builder

    builder Junior Member

    Joined:
    Jul 31, 2009
    Messages:
    100
    Likes Received:
    17
    Buddy,

    just use google:CURL multithreading
    There are lot of them.
     
  3. nambooooo

    nambooooo Regular Member

    Joined:
    May 21, 2009
    Messages:
    219
    Likes Received:
    71
    Location:
    GreenMTN
    I use the following class for multithreading curl requests
    Code:
    http://semlabs.co.uk/journal/object-oriented-curl-class-with-multi-threading
    Although there was a php curl class that allows non blocking, or something like that, lol. Basically, you set the number of threads, let's say 10 and feed 100 requests. The class takes first 10 request and precesses those and when just one request is done takes the next from queue and adds it for processing. It saves time.
     
    • Thanks Thanks x 1