From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 9C9571F463 for ; Mon, 6 Jan 2020 20:51:05 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 3D89D120A32; Tue, 7 Jan 2020 05:50:52 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id DB6331209E8 for ; Tue, 7 Jan 2020 05:50:50 +0900 (JST) Received: by filterdrecv-p3mdw1-56c97568b5-s6xnl with SMTP id filterdrecv-p3mdw1-56c97568b5-s6xnl-18-5E139DB2-3 2020-01-06 20:50:58.014304922 +0000 UTC m=+1800471.361419184 Received: from herokuapp.com (unknown [18.209.103.75]) by ismtpd0103p1mdw1.sendgrid.net (SG) with ESMTP id KFc74BzuQwGSehln-agAgQ for ; Mon, 06 Jan 2020 20:50:57.929 +0000 (UTC) Date: Mon, 06 Jan 2020 20:50:58 +0000 (UTC) From: samuel@oriontransfer.net Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 72356 X-Redmine-Project: ruby-master X-Redmine-Issue-Id: 8215 X-Redmine-Issue-Author: halorgium X-Redmine-Issue-Assignee: ioquatix X-Redmine-Sender: ioquatix X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?cjxb6GWHefMLoR50bkJBcGo6DRiDl=2FNYcMZdY+Wj30TDyX1Soxrv7H4dwTn0Vt?= =?us-ascii?Q?IkQXIlnhS=2FrrdhtUjfpjYQugIYNXG6UZD1uktey?= =?us-ascii?Q?jftQt6+qD2iCCX6a8E37jUfQLuS4SgH7fEGBgTG?= =?us-ascii?Q?H10qHywDvCol+USsAjzF0GvxcAh9fymCEALbUw=2F?= =?us-ascii?Q?W8xpfzSAnNUEVzM9y5ssNSK9kx4ToyDb7FNlISd?= =?us-ascii?Q?D3t2YBWAv6gxnks3E=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 96694 Subject: [ruby-core:96694] [Ruby master Feature#8215] Support accessing Fiber-locals and backtraces for a Fiber X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #8215 has been updated by ioquatix (Samuel Williams). @eregon I agree with your points. I respect that you've studied a lot in your thesis so ultimately I'll defer to your judgement. But let me explain a bit more. The reason for expanding the `Fiber#` interface is so that tools like `async` can show better debugging of all fibers. Ideally it can show the backtrace, and allow the user to check fiber locals (and maybe even get a list of keys for debugging purposes). I'd also be okay with adding `Fiber.[]` and so on, but that's kind of a separate issue. Thread safety is not my concern, the function can be marked as thread unsafe, and maybe we can add detection of this and warn against it. ---------------------------------------- Feature #8215: Support accessing Fiber-locals and backtraces for a Fiber https://bugs.ruby-lang.org/issues/8215#change-83679 * Author: halorgium (Tim Carey-Smith) * Status: Assigned * Priority: Normal * Assignee: ioquatix (Samuel Williams) * Target version: ---------------------------------------- =begin As part of debugging celluloid, I have been wanting to diagnose where the Fibers are running and their various locals. I would expect the following to work. Thread.current[:key] = "outside" fiber = Fiber.new do Thread.current[:key] = "inside" Fiber.yield end fiber.resume fiber[:key] == "inside" # true fiber.backtrace # ... I also wonder whether (({Fiber#[]})) should be implemented, so (({Fiber.current[:key]})) is possible. For reference, here is the issue on the rubinius issue tracker: ((<"github/rubinius/rubinius/2200"|URL:https://github.com/rubinius/rubinius/issues/2200>)) =end ---Files-------------------------------- 0001-cont.c-fiber-local-accessors.patch (2.94 KB) -- https://bugs.ruby-lang.org/