title: Php: when to use pthread
body: <p>I don't know much about using threads but I looked into pthreads for php and it seems very interesting and easy, or easier than I thought... </p>
  
  <p>I searched for examples and looked through the documentation but I couldn't find any real-world examples of when it is actually beneficial to use threads, it sure is for long tasks that don't depend on each other like doing many http requests or maybe sending mails. </p>
  
  <p>But what about
  Writing log entries?
  Inserts to databases? (like tracking user activity)
  Fetching from database (can I return data from a thread?) </p>
  
  <p>Will this increase performance or is the overhead of creating threads too much? (although I could use a worker pool too get less overhead, I think... )</p>
  
  <p>Any advice or examples are greatly appreciated! </p>