News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Reddit.com:
Multithreading in PHP with pthreads
August 05, 2013 @ 11:21:31

On Reddit.com there's a post from krakjoe talking about using multithreating in PHP, specifically with pthreads. Unfortunately, there's several misconceptions about the pthreads (and concurrency) that still makes it difficult in PHP. The post lists a few of them:

  • PHP is not thread safe, there are lots of extensions that will give your application cooties.
  • pthreads is old fashioned
  • pthreads does not include everything you need to execute safely
  • pthreads unsafely shares memory among contexts in order to provide concurrent functionality
  • pthreads is beta and should be avoided at all costs

The author points out that pthreads are still in more of a "beta" state and probably shouldn't be used in production (though some do):

Multi-threading in PHP sounds like some sort of voodoo, for so long it's been something that was either impossible in the minds of php programmers, or a bad idea to try and emulate. pthreads doesn't emulate anything, it leverages bundled functionality and the object API to provide true userland multi-threading.
0 comments voice your opinion now!
multithread pthreads extension summary misconceptions

Link: http://www.reddit.com/r/PHP/comments/1jo517/multithreading_in_php_with_pthreads/

blog comments powered by Disqus

Similar Posts

Lorna Mitchell: Managing PHP 5.4 Extensions on Ubuntu

Chris Jones' Blog: PHP 5.3.8 RPMs are on oss.oracle.com

LaughingMeme.com: Looking at PHP5ís DateTime and DateTimeZone

SitePoint PHP Blog: PHP extension for Cairo graphics library

LaughingMeme.com: Looking at PHP5ís DateTime and DateTimeZone


Community Events





Don't see your event here?
Let us know!


series podcast community framework opinion install threedevsandamaybe testing refactor api introduction unittest interview developer code list laravel release wordpress language

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework