Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47701 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94622 invoked from network); 1 Apr 2010 14:32:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Apr 2010 14:32:43 -0000 Authentication-Results: pb1.pair.com smtp.mail=speedy.spam@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=speedy.spam@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.153 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: speedy.spam@gmail.com X-Host-Fingerprint: 72.14.220.153 fg-out-1718.google.com Received: from [72.14.220.153] ([72.14.220.153:27162] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2F/E5-01137-A8EA4BB4 for ; Thu, 01 Apr 2010 09:32:43 -0500 Received: by fg-out-1718.google.com with SMTP id 22so741813fge.11 for ; Thu, 01 Apr 2010 07:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:reply-to:x-priority :message-id:to:subject:mime-version:content-type :content-transfer-encoding; bh=WsKwWlKeEerG2cPcMFEQtRU66y/tsts3EW7yLC9R+KA=; b=FGLFaVIJEhiMLhlq6A0c+8LQxzAV6TVkjp2Li2VoxmkqzQMRokbCWrBtvC2htQZHvI F66WMousFSvXTbp6UaLlNB6hSsX3L5tFbRyA4C0s++XD+P/FuvxBtPqprVTrqYrFjuDT 48dRazsU/o0WDV5GoWiGt3UOkjwyugRgOg/Nw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:reply-to:x-priority:message-id:to:subject:mime-version :content-type:content-transfer-encoding; b=YT/+fYwZ4ffyOzWUuO75I4mTIUmc0ZSy9aFOWcl60H/g3lsMGqvN+dnGLCCZ6LxBH8 5umyVbjIyeG0EuKSeyOlwiym9Dbn0gzFFXAyNtXWPn8YdO9v/0Wyg7rznNmK/6Wz5Pcq 9/W4L6p3lWhWFzhmE792kfN2ZpGBN7H0rijno= Received: by 10.87.48.34 with SMTP id a34mr2234081fgk.2.1270132359611; Thu, 01 Apr 2010 07:32:39 -0700 (PDT) Received: from tankgirl (cable-94-189-204-252.dynamic.sbb.rs [94.189.204.252]) by mx.google.com with ESMTPS id 12sm2785392fgg.19.2010.04.01.07.32.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Apr 2010 07:32:39 -0700 (PDT) Date: Thu, 1 Apr 2010 16:32:15 +0200 Reply-To: speedy X-Priority: 3 (Normal) Message-ID: <1941231697.20100401163215@gmail.com> To: internals@lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: php and multithreading (additional arguments) From: speedy.spam@gmail.com (speedy) Hello PHP folks, I've seen this discussed previously, and would like to add a few arguments for the multi-threading side vs. async processing, which I've seen mentioned as a viable alternative: 1. Imagine that from time to time, some background processing takes 1 second of CPU time - w/o multithreading, all your async operations, like accepting a connection to a socket, aio or others are basically stalled. So, async is a good approach, but does not work as a magic wand for all problem spaces. Alternatively, you could fork and then d= o the processing, but then the state syncing of the forked background proce= ssing results with the main thread requires a whole new protocol / switchin= g to interprocess communication, which makes such developments unnecessari= ly hard. Threads exist for a _reason_ not only because they sound cool. 2. Without thread support, it is not possible to use multi-core proce= ssing paradigms directly from PHP - which means PHP relies on external fram= eworks for that feature, which, in a sense, makes it a non-general-purpose langu= age. It _could become_ a general purpouse tool, if it had proper multi-thr= eading support built-in. I, personally, considered developing websockets / nanoserv server sta= ck with PHP and bumped into the multithreading limitation - AFAIK it is the only = big feature separating PHP from the general purpouse languages. Everything else i= s well integrated with lots of external libraries/modules giving rise to pot= ential rapid application development while using it. Cheers and let me know about your thoughts, and potential core implem= entation issues regarding developing this language feature. --=20 Best regards, speedy mailto:speedy.spam@gmail.com