Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112608 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60329 invoked from network); 23 Dec 2020 06:57:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Dec 2020 06:57:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7C0B51804DD for ; Tue, 22 Dec 2020 22:30:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mercury.negativeion.net (mercury.negativeion.net [199.38.81.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 22 Dec 2020 22:30:15 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id 4E5E320BC806C9; Wed, 23 Dec 2020 01:30:15 -0500 (EST) Received: from mercury.negativeion.net ([127.0.0.1]) by localhost (mercury.negativeion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Pn_1C3USbAiQ; Wed, 23 Dec 2020 01:30:14 -0500 (EST) Received: from [10.0.1.102] (unknown [173.225.146.47]) by mercury.negativeion.net (Postfix) with ESMTPSA id 7653E20BC806B9; Wed, 23 Dec 2020 01:30:14 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) In-Reply-To: Date: Wed, 23 Dec 2020 00:30:13 -0600 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <7D3C7052-318C-4E02-8E59-D313D4C84ED1@trowski.com> References: <08E75593-0599-48B1-9C2D-D920EE942BAD@trowski.com> To: Mike Schinkel X-Mailer: Apple Mail (2.3608.120.23.2.4) Subject: Re: [PHP-DEV] [RFC] Fibers From: aaron@trowski.com (Aaron Piotrowski) Hi Mike, > On Dec 21, 2020, at 7:38 PM, Mike Schinkel = wrote: >=20 > Would it be appropriate of me to ask for a section that discusses how = that might be done in user space in the RFC, at least with some simple = pseudo-code, or if is it non-trivial than a link to where it is = discussed in depth?=20 Absolutely! I added a short example implementation of a mutex to the RFC = under = https://wiki.php.net/rfc/fibers#how_do_various_fibers_access_the_same_memo= ry. The code uses a simple queue of fibers waiting to access the mutex = to acquire and release the lock. A channel might be implemented with a queue of messages where the = receiving fiber suspends if the queue is empty. Sending a message on the = channel would resume a suspended fiber that was waiting to receive a = message. Hopefully that helps. If something is still unclear or an additional = example would help, don't hesitate to ask. Cheers! Aaron Piotrowski