From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS24940 94.130.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1FA201F642 for ; Tue, 31 Jan 2023 16:20:58 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=0XNsHGnH; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=EZD9tk5M; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id B687F7F063; Tue, 31 Jan 2023 16:20:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1675182050; bh=oTlCAO+nAYscUdVeJsLRkiecmx88t6iW96tGPNc4oGo=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=0XNsHGnHDUyEPJ+q+CHu/nq82mcnNyU8BZ4kq/qTWZge+Wlyjt9IMEiRZREjXXqCC DtmdXoTOTGIVOhW4cdN0vJhqDizjZqT9TD6vv7zaBP+WwKOBhuGlB5lHA6vHq0g/nt TGsnKw2vHawTGEz8UP6jw9j5e0lmuvgVJ1bf8+Hw= Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by nue.mailmanlists.eu (Postfix) with ESMTPS id D0AEC7F05D for ; Tue, 31 Jan 2023 16:20:47 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=EZD9tk5M; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=xqy/Pyk4i3DQeZ2IEdsKkazI2VRmT2s8dCF0AETPCvo=; b=EZD9tk5MmJ4fecY7HhHciM0Gk36+Z6DDi8sF5RY8oaZ2LGPZg+MAK2ci17VFEc05Hv4e bMc0HPAYyCaOTzmGQORO9KR0uCtig80mwdcf4jr2GfveZpxbVK9SCtSdVePAd/ZOMESkTq UhN7da8nXmzo9NORPepmcnWBI4ftA7XdFu1Y2uagPvx3wIhXPLFULY2k2MwzaXASJf1a+l VW5Ez86d5dPLMG7BVOhsfO3j2AkQc4QCDP50dhfi2DvBMZEf1zKJcWL0KLj5xJgPgMYIxQ pYPK9YJA2ns7Bo3V40COKdyfvBBIEqONv5M7Vq0DhFQVNx7v9V5HtvHGDBm15CRA== Received: by filterdrecv-6f5868ff54-zngk6 with SMTP id filterdrecv-6f5868ff54-zngk6-1-63D93FDD-3C 2023-01-31 16:20:45.941343725 +0000 UTC m=+6455639.511984957 Received: from herokuapp.com (unknown) by geopod-ismtpd-4-0 (SG) with ESMTP id Fe0hkPO_TdCb1QKDO57DsQ for ; Tue, 31 Jan 2023 16:20:45.862 +0000 (UTC) Date: Tue, 31 Jan 2023 16:20:46 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 19154 X-Redmine-Issue-Author: fxn X-Redmine-Issue-Assignee: ko1 X-Redmine-Sender: luke-gru 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-Redmine-MailingListIntegration-Message-Ids: 88530 X-SG-EID: =?us-ascii?Q?NolEzGrSupqd1yGX5VUUH0FR5S3PWbtU7ykbJoN2A9NE30FctmfRpn=2F0IVp0YE?= =?us-ascii?Q?juYdxriVUH0u7=2F4zG=2FXhAZvpDD936cuEo0yAaEf?= =?us-ascii?Q?Ki69+jcSj3G43kotYukANiPFmcO7OJcx5jjkvoJ?= =?us-ascii?Q?CDXu+JitGKPGwdXIu5bDlczxRuWN+KHo9uEqd+t?= =?us-ascii?Q?dHuhuINVmdpm9QP1Cf14OC8uEwUOrIYcCFoNwaK?= =?us-ascii?Q?=2FiSFPxYw2po3W12v1VNN0coNLT2co5e4ZzIQDxS?= =?us-ascii?Q?51V2Ykxhhu3QjPBEB=2FuNQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: KQOAI5ARPVQAKNYLHLB4PNRJP36E4IRI X-Message-ID-Hash: KQOAI5ARPVQAKNYLHLB4PNRJP36E4IRI X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:112141] [Ruby master Bug#19154] Specify require and autoload guarantees in ractors List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "luke-gru (Luke Gruber) via ruby-core" Cc: "luke-gru (Luke Gruber)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #19154 has been updated by luke-gru (Luke Gruber). Ah okay, I see thanks Eregon, I was confused b/t VM lock and GVL. There could be cross-ractor mutexes and monitors if they locked the VM lock, no? Then if rubygems used these, then it would be safe? I'm not saying it's a good idea, just that it's possible :) I imagine it's a bit of a pain to have to eager autoload everything before you start a Ractor, but if that's what needs to be done then c'est la vie. ---------------------------------------- Bug #19154: Specify require and autoload guarantees in ractors https://bugs.ruby-lang.org/issues/19154#change-101577 * Author: fxn (Xavier Noria) * Status: Open * Priority: Normal * Assignee: ko1 (Koichi Sasada) * ruby -v: ruby 3.2.0preview3 (2022-11-27) [x86_64-darwin22] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Given a file `c.rb`: ```ruby class C end ``` the following script: ```ruby r1 = Ractor.new do require './c.rb' end r2 = Ractor.new do require './c.rb' end r1.take r2.take ``` raises: ``` % ruby -v foo.rb ruby 3.2.0preview3 (2022-11-27) [x86_64-darwin22] foo.rb:1: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues. # terminated with exception (report_on_exception is true): # terminated with exception (report_on_exception is true): :164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' from foo.rb:6:in `block in
' :37:in `require':164:in `ensure in require': : can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from foo.rb:2:in `block in
' :37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from foo.rb:2:in `block in
' from foo.rb:6:in `block in
' :698:in `take': thrown by remote Ractor. (Ractor::RemoteError) from foo.rb:9:in `
' :164:in `ensure in require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from :167:in `require' from foo.rb:2:in `block in
' :37:in `require': can not access non-shareable objects in constant Kernel::RUBYGEMS_ACTIVATION_MONITOR by non-main ractor. (Ractor::IsolationError) from foo.rb:2:in `block in
' ``` Would it be possible to have documentation about their interaction? This is important also to understand autoloading within ractors, since constant references may trigger `require` calls. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/