0

Now we are working on a small web application we started this with php but we have some requirement to create some threads in php, what are advantage and disadvantage of PHP threads . how php handling synchronisation for common data.

my requirement are given bellow

  1. User can create some background jobs.
  2. in each thread we want to create some child threads.
  3. in run time thread properties can be configurable
7
  • What about the manual ? php.net/manual/en/class.thread.php Commented May 18, 2015 at 6:09
  • @Frederik.L ya i read that manual .. and i searched lot of blogs, i got only it possible, but no real world performance or nothing regarding PHP threads. Commented May 18, 2015 at 6:12
  • What do you mean by performance? What are your requirements? There are lots (lots!) of tutorials out there which deal with php threads. Commented May 18, 2015 at 6:14
  • Too broad IMO. This question is about any information anyone could give about anything related to threads. There is no right answer neither complete answer to this question, hence I'd recommend improving the question so it actually asks something that can be answered. Commented May 18, 2015 at 6:17
  • @davidgiga1993 can u share some links ,i am not a php developer ,for a particular requirement we choose php Commented May 18, 2015 at 6:26

2 Answers 2

1

Yes, it is possible, Pthread library is what you need to use.

For windows:

You will have to install some dlls

For linux:

You might need to recompile php using zts because by default it is disabled or not installed.

Sign up to request clarification or add additional context in comments.

Comments

1

It is possible to use threads in PHP. The advantages/disadvantages are the same as in any other programming language.

Take a look at the manual for more information: http://php.net/manual/en/book.pthreads.php

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.