Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102157 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3842 invoked from network); 29 May 2018 10:18:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 May 2018 10:18:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=zaq178miami@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=zaq178miami@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.180 as permitted sender) X-PHP-List-Original-Sender: zaq178miami@gmail.com X-Host-Fingerprint: 209.85.216.180 mail-qt0-f180.google.com Received: from [209.85.216.180] ([209.85.216.180:35346] helo=mail-qt0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5B/0E-01681-7092D0B5 for ; Tue, 29 May 2018 06:18:48 -0400 Received: by mail-qt0-f180.google.com with SMTP id j1-v6so17914994qtp.2 for ; Tue, 29 May 2018 03:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=fewLx7Vbswfb+C+o96zxnwzamQsNV2/nNw7avR+HZC0=; b=bQVDmOW31rZGTU0sBd6yr5LgLaje3Eav9Um5v1JmzLZZtR9o9rucgkkdczR2gSfe88 HhsO1XbvYDRnq8c2BycoTud47DuJOWviv8X6JBrAxQsAK29OzKNk/ZdtxA1576htIpV3 9uACM7MThdyeYjbO/Ci8vYYFdvqma5Go/YcVgyZ7QYYCa3qI6DbnhZoSSoE0F8+pm55p mb8sZsXqN3WBihuVnMIbFnLZ1xefPcB6cUDcOUPJjMhYw5lmtR7n7uhERFjAkUWYeX4B sOyK6DIPNt8uo5+bNxNfUKqBUpMtKV2f9XBTBbIYvowFusLi4Dw/EjxGDuMSfyQOmlwE hmlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fewLx7Vbswfb+C+o96zxnwzamQsNV2/nNw7avR+HZC0=; b=E9S5CF/YO9nEAV7p/y9+rrjlVo2P+j+kVscfmunwLUQeh0PHZsizyg+otcke0JUF73 GvIglrOnGz2NfNnYof7IQa6i/B5X/4IF3hq7mwrhoiwBlyBN9y7WigjkpOyT1KvzVcB7 XhhK5Kaq2+FAhAhgXG8f4QTViIB6OUQmPVF39edEK35ieo7Fal8yQrF/ExKAPWUNInDe DNKEuoEuR6GZ2551j+YnoZonE5y3UdL1dHrjUJeZAPtWsAtoFJeHlpPN71Kk66aUJjrA KZWQtB3oc9V4yCaAlKtGbSMthnhoMVc/BASsJ8X1ErFZFqNExnX+yjLCl3K6qJFApBes NreA== X-Gm-Message-State: ALKqPwf09NbHyvOuEjCmr+H6aH+/DaUG2z6kANmADzh98SNKjVVFDLZr tsbYirbhLd6BNN7bm6sIBWq7EGwh X-Google-Smtp-Source: ADUXVKJ8qETZUmzZ3Z+O5/TK1IVizBI1uW7HNORpMlhF4GD8XLoy5vQUK+7CNyfJfgtsq36WBxdc1Q== X-Received: by 2002:ac8:7355:: with SMTP id q21-v6mr15584794qtp.27.1527589125226; Tue, 29 May 2018 03:18:45 -0700 (PDT) Received: from Bogdans-MBP.local ([95.67.58.122]) by smtp.gmail.com with ESMTPSA id c20-v6sm21416639qkm.59.2018.05.29.03.18.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 03:18:44 -0700 (PDT) To: Joe Watkins References: Cc: internals@lists.php.net Message-ID: <885cc344-360a-c8b2-f7f4-833d156940b8@gmail.com> Date: Tue, 29 May 2018 13:18:42 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: RFC WeakRefs From: zaq178miami@gmail.com (Bogdan Padalko) On 5/17/18 9:09 AM, Joe Watkins wrote: > Morning internals, > > I'd like to raise for discussion https://wiki.php.net/rfc/weakrefs > > Am I missing anything ? > > Cheers > Joe > Hi, Would we benefit having notification mechanism in weak references? I implemented such notification in https://github.com/pinepain/php-ref, (used https://github.com/colder/php-weakref as a reference). The only issue is that how notification logic should behave when unclean shutdown happens, the culprit is some exception thrown which leads to referent object destruction and this uncertainty doubles when notification logic (callback) also triggers exception. So I bring this question more for discussion and it could be definitely implemented later (small working feature is better then large non-working one). Seen that there is weak data structs discussion below, there is https://github.com/pinepain/php-object-maps weak/soft map implementatoin I made at the time of php-ref extension. It somehow based on java maps interface and I think with notification interface for weak refs it's fairly simple to implement such maps in userland THOUGH without notification, having primitive weakmap in the psl needs to be taken with care to do not end up like other psl data structs.