Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47721 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68107 invoked from network); 1 Apr 2010 20:16:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2010 20:16:01 -0000 Authentication-Results: pb1.pair.com header.from=indeyets@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=indeyets@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.78.25 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: 74.125.78.25 ey-out-2122.google.com Received: from [74.125.78.25] ([74.125.78.25:14110] helo=ey-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/35-44965-00FF4BB4 for ; Thu, 01 Apr 2010 15:16:01 -0500 Received: by ey-out-2122.google.com with SMTP id d26so111291eyd.39 for ; Thu, 01 Apr 2010 13:15:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=Efq75B/oRcuck+hQVnmq0CqCKHLS6n+wgKhyudlS7Ac=; b=uiWWbyGjerGUCz0l0JWB6g5Vb+G4tA//wkzeDhIIfV+yyULprsxEpI2KqKlLKSE4lu /aXYWj0MoLEVZQzOOw0pnD9DEpVIRZn3DRMLWQJDrPlb79xU7MVOkBBETzZCb89Cuf4X v/yupfgkquQlXCNnl8dnRwZB2xTj83HhJWukQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=Vya5OOJGaBrCJDnuJLY1D6lJhb8gqY5re3IJqr18MNVpNyMim7v67xIwlaLOIlof04 IYgSymnsb/LURyPE8gMt9t34QzgSVXqDirEfgCBRM+zJp1Og357v0It5uyzcK/ifnJpK Gye1CXmbX31kgIAmT/B7KhdMHNhfI+f68sk1E= Received: by 10.213.110.135 with SMTP id n7mr754401ebp.58.1270152956381; Thu, 01 Apr 2010 13:15:56 -0700 (PDT) Received: from nirvana.lan ([93.185.190.227]) by mx.google.com with ESMTPS id 16sm4644795ewy.11.2010.04.01.13.15.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Apr 2010 13:15:55 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii In-Reply-To: <4BB4E80A.3000402@zend.com> Date: Fri, 2 Apr 2010 00:15:50 +0400 Cc: speedy , internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <5BAD9F0C-858B-4DE5-9303-C1FF08F19C65@gmail.com> References: <1941231697.20100401163215@gmail.com> <4BB4E80A.3000402@zend.com> To: Stanislav Malyshev X-Mailer: Apple Mail (2.1078) Subject: Re: [PHP-DEV] php and multithreading (additional arguments) From: indeyets@gmail.com (Alexey Zakhlestin) On 01.04.2010, at 22:38, Stanislav Malyshev wrote: > Hi! >=20 >> processing, but then the state syncing of the forked background = processing >> results with the main thread requires a whole new protocol / = switching to >> interprocess communication, which makes such developments = unnecessarily >> hard. Threads exist for a _reason_ not only because they sound = cool. >=20 > Interesting thing here threads would require (at least if they are = implemented the way C, etc. threads usually work) whole new protocol of = synchronization too. Just think about something: do you have shared = classes/variables/etc.? > If you do, how you control access to them? Hello locks and the whole = can of worms! Most people that think they can program in threads = actually are just pushing their luck until some complex interaction = leaves their app malfunctioning in a bizarre way and them without any = means to debug it. I mean, you can do it right, but it's usually harder = than it looks. Share-nothing exists for a reason too :) Well, strictly speaking, there are [at least] 2 models which can be = used: 1) Classical with shared resources and locking 2) STM Anyway, do we really have to tell people "you don't need it" when they = believe that they do? Python has multithreading and it works reasonably good. People who know = what they are doing can implement really brilliant solutions (think = Tornado) And something like GIL feels like a reasonable compromise to me.=