Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35683 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85410 invoked by uid 1010); 21 Feb 2008 11:53:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 85394 invoked from network); 21 Feb 2008 11:53:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2008 11:53:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.184.233 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: indeyets@gmail.com X-Host-Fingerprint: 64.233.184.233 wr-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.184.233] ([64.233.184.233:58905] helo=wr-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/E0-10952-8466DB74 for ; Thu, 21 Feb 2008 06:53:44 -0500 Received: by wr-out-0506.google.com with SMTP id c38so2476wra.17 for ; Thu, 21 Feb 2008 03:53:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=L+We/2xGddVGp0X/KJQehQYiSz9ZEi//86tBiIUjPGo=; b=JEVQ6QWbjlyVFgW7hCIkeZOYkocsXC/cuijeDqc5/xKjElD4vgqN9bFlgoX3mTNZgWQTcYZg9vizaFUzsuwvmlY6kKlodQBPRcvSljXzaKKj0TJYF/hFHnYFYxZWoh0lwaY26UVdRYgtsHHUI9yIVhJCab83Y+Kg+67lrSC2yEs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qpS9b6WKoJyj+OLDGGKOXBz8sTvFq8FXdOJzv02AKphB5HUpU35wxuCCsDvvQARqKsHryt2LSRw8+ESmw4RVO6Nn7Jf5AJ3MlMudwkrBBcPpLmdWvDxxMLywrFXQQHpgpDysNYZb0sglmsjyvToHCsHeT9T+gQLNR9ugtXNw8WI= Received: by 10.151.154.20 with SMTP id g20mr3124259ybo.62.1203594819678; Thu, 21 Feb 2008 03:53:39 -0800 (PST) Received: by 10.150.57.12 with HTTP; Thu, 21 Feb 2008 03:53:39 -0800 (PST) Message-ID: Date: Thu, 21 Feb 2008 14:53:39 +0300 To: nrixham@gmail.com Cc: internals@lists.php.net In-Reply-To: <7A.50.10952.9A16DB74@pb1.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7A.50.10952.9A16DB74@pb1.pair.com> Subject: Re: [PHP-DEV] Multi-threading From: indeyets@gmail.com ("Alexey Zakhlestin") On 2/21/08, Nathan Rixham wrote: > hope you don't mind me asking for a bit more info, I was always under > the impressions that a thread is defined as (quote wiki) > > "Threads are a way for a program to fork (or split) itself into two or > more simultaneously (or pseudo-simultaneously) running tasks. Threads > and processes differ from one operating system to another but, in > general, a thread is contained inside a process and different threads of > the same process share some resources while different processes do not." > > and php supports pcntl_fork along with signal handlers and interprocess > communication via functions like or stream_socket_pair. > > as such if I set up a cli app with parent and child processes > (?threads), then isn't this multithreading in php? > > I know this strictly isn't the place for such questions, but I hope you > won't mind enlightening me a little on the matter. it is not multithreading. multithreading means that a process starts several "threads" which work simulatenously and share local resources (such as variables, dynamically created functions/classes, database connections, etc.) pcntl_fork creates several processes, which can communicate, but still has their own sets of local resources -- Alexey Zakhlestin http://blog.milkfarmsoft.com/