Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47732 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49048 invoked from network); 2 Apr 2010 07:15:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Apr 2010 07:15:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.216 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.218.216 mail-bw0-f216.google.com Received: from [209.85.218.216] ([209.85.218.216:60960] helo=mail-bw0-f216.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/62-44965-18995BB4 for ; Fri, 02 Apr 2010 02:15:14 -0500 Received: by bwz8 with SMTP id 8so1347608bwz.23 for ; Fri, 02 Apr 2010 00:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=mMG0tM/u3twsZQOetMbfNbcg9pwz65XxoeDEnnlSeMo=; b=FTBnIQ5+/DB21v9E+clbF52xiyat9zx1jiMyAI6S30nU3hxVT4t7VqiLcNRV5CXfo5 wnIVm7DcvK2iGBXddBzf70WcRMKvrS/xOFj29cpx185ThSpGVSvN01seXxVV5kjBltP7 d2xrSJXXXI+u3Y/3QxSLv0XKGLSGiLbVGkPo8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=MGGhSZGbKUa/WqvP9egT1s8oQFwPnwkKc3MR2zl623WdXxmZEkmkBY2d9mc3zCrLCg CbUcX+/OY4RMGTW9b02dTIxCYQJTfYTRfSsdobji9LFeTbT3p7jjz5os6NUJ7+85lXhD YdrF4kOzQY4GLRRm9omo+KtlXaehg9ttBalOQ= MIME-Version: 1.0 Received: by 10.204.64.200 with HTTP; Fri, 2 Apr 2010 00:15:10 -0700 (PDT) In-Reply-To: References: <1941231697.20100401163215@gmail.com> Date: Fri, 2 Apr 2010 09:15:10 +0200 Received: by 10.204.174.199 with SMTP id u7mr2715911bkz.38.1270192510987; Fri, 02 Apr 2010 00:15:10 -0700 (PDT) Message-ID: To: Dennis Hotson Cc: speedy , internals@lists.php.net Content-Type: multipart/alternative; boundary=000325554e4669efb304833bbd8b Subject: Re: [PHP-DEV] php and multithreading (additional arguments) From: tyra3l@gmail.com (Ferenc Kovacs) --000325554e4669efb304833bbd8b Content-Type: text/plain; charset=UTF-8 On Fri, Apr 2, 2010 at 1:04 AM, Dennis Hotson wrote: > I use pcntl_fork() for writing parallel multi-process applications and it > works pretty well. > Also, you can use shared memory queues to pass messages between processes > (ie msg_get_queue()). > > I wrote a little proof of concept library a while ago to demonstrate: > http://github.com/dhotson/Phork > > It's not that complicated... the main part of it is only ~110 lines of > code: > http://github.com/dhotson/Phork/blob/master/classes/Phork/Process.php > > Regards, > Dennis > > Yes, the pcntl_fork does exists, but there are some things that better with threading: * support on windows * easier inter-process/inter-thread communication/data passing. * threads are cheaper Tyrael --000325554e4669efb304833bbd8b--