1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is threading in PHP?

Discussion in 'PHP' started by eritrea1, Sep 27, 2013.

  1. #1
    Or in programming for that matter?
    This is the term, I keep hearing a lot these days, and even though I Google to find out, but I can't find a beginner-friendly answer. My knowledge, about programming does not extend more than PHP, even that is scripting, but I have yet to understand the most basic concept, and purpose of thread, threading, pthread in php (I am thinking they all mean the same)
     
    eritrea1, Sep 27, 2013 IP
  2. xxxize

    xxxize Member

    Messages:
    33
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    38
    #2
    threading or multithreading is parallel process of 2 or more codes or programs.
    In php there is no real multithreading and it's not necessary. Because you trying to keep light codes with very sort time of execution to save resources from your server.
    This is a good link to explain how the thing goes with php and multithreading via "pseudo".
    http://phplens.com/phpeverywhere/?q=node/view/254
     
    xxxize, Sep 27, 2013 IP
  3. krakjoe

    krakjoe Well-Known Member

    Messages:
    1,795
    Likes Received:
    141
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Wrong ... http://docs.php.net/Thread

    If you really have never heard of multi-threading before, I'm not really sure I can give you a good starting place ... but I'll try ...

    http://en.wikipedia.org/wiki/Multithreading_(software)#Multithreading

    Read the first paragraph of that wikipedia entry for a general explanation multi-threading, then read

    https://gist.github.com/krakjoe/6437782/

    If there's anything you've heard up to this point that you really do not understand, then research it, there's no time like the present to learn.

    Then look at all the examples that come with pthreads (on github https://github.com/krakjoe/pthreads/), then if you're not feeling overwhelmed, have a ruddy go :)
     
    krakjoe, Sep 27, 2013 IP