* [ruby-core:119050] [Ruby master Feature#20715] `Ractor.[]` and `Ractor.[]=` to access Ractor local storage
@ 2024-09-05 2:35 ko1 (Koichi Sasada) via ruby-core
2024-09-06 15:38 ` [ruby-core:119086] " Eregon (Benoit Daloze) via ruby-core
2024-09-06 19:13 ` [ruby-core:119090] " byroot (Jean Boussier) via ruby-core
0 siblings, 2 replies; 3+ messages in thread
From: ko1 (Koichi Sasada) via ruby-core @ 2024-09-05 2:35 UTC (permalink / raw)
To: ruby-core; +Cc: ko1 (Koichi Sasada)
Issue #20715 has been reported by ko1 (Koichi Sasada).
----------------------------------------
Feature #20715: `Ractor.[]` and `Ractor.[]=` to access Ractor local storage
https://bugs.ruby-lang.org/issues/20715
* Author: ko1 (Koichi Sasada)
* Status: Open
* Assignee: ko1 (Koichi Sasada)
----------------------------------------
Trivial proposal.
Now `Ractor#[]/#[]=` is supported to access current ractor local storage. However, it doesn't allow to access local storage of other ractors.
```ruby
Ractor.current[:foo] = 1
Ractor.new{
p Ractor.main[:foo] #=> nil
}.take
```
So providing `Ractor.[]/[]=` is more reasonable.
Further more, we don't need to use `Ractor#current` and it is slightly faster.
--
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/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-core:119086] [Ruby master Feature#20715] `Ractor.[]` and `Ractor.[]=` to access Ractor local storage
2024-09-05 2:35 [ruby-core:119050] [Ruby master Feature#20715] `Ractor.[]` and `Ractor.[]=` to access Ractor local storage ko1 (Koichi Sasada) via ruby-core
@ 2024-09-06 15:38 ` Eregon (Benoit Daloze) via ruby-core
2024-09-06 19:13 ` [ruby-core:119090] " byroot (Jean Boussier) via ruby-core
1 sibling, 0 replies; 3+ messages in thread
From: Eregon (Benoit Daloze) via ruby-core @ 2024-09-06 15:38 UTC (permalink / raw)
To: ruby-core; +Cc: Eregon (Benoit Daloze)
Issue #20715 has been updated by Eregon (Benoit Daloze).
+1, makes perfect sense (IMO it would be nice to do the same for Fiber and Thread as well but out of scope of this issue).
----------------------------------------
Feature #20715: `Ractor.[]` and `Ractor.[]=` to access Ractor local storage
https://bugs.ruby-lang.org/issues/20715#change-109674
* Author: ko1 (Koichi Sasada)
* Status: Open
* Assignee: ko1 (Koichi Sasada)
----------------------------------------
Trivial proposal.
Now `Ractor#[]/#[]=` is supported to access current ractor local storage. However, it doesn't allow to access local storage of other ractors.
```ruby
Ractor.current[:foo] = 1
Ractor.new{
p Ractor.main[:foo] #=> nil
}.take
```
So providing `Ractor.[]/[]=` is more reasonable.
Further more, we don't need to use `Ractor#current` and it is slightly faster.
--
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/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ruby-core:119090] [Ruby master Feature#20715] `Ractor.[]` and `Ractor.[]=` to access Ractor local storage
2024-09-05 2:35 [ruby-core:119050] [Ruby master Feature#20715] `Ractor.[]` and `Ractor.[]=` to access Ractor local storage ko1 (Koichi Sasada) via ruby-core
2024-09-06 15:38 ` [ruby-core:119086] " Eregon (Benoit Daloze) via ruby-core
@ 2024-09-06 19:13 ` byroot (Jean Boussier) via ruby-core
1 sibling, 0 replies; 3+ messages in thread
From: byroot (Jean Boussier) via ruby-core @ 2024-09-06 19:13 UTC (permalink / raw)
To: ruby-core; +Cc: byroot (Jean Boussier)
Issue #20715 has been updated by byroot (Jean Boussier).
> it would be nice to do the same for Fiber and Thread as well
Would also be the occasion for `Thread[]` to be actual thread local instead of fiber local.
----------------------------------------
Feature #20715: `Ractor.[]` and `Ractor.[]=` to access Ractor local storage
https://bugs.ruby-lang.org/issues/20715#change-109678
* Author: ko1 (Koichi Sasada)
* Status: Open
* Assignee: ko1 (Koichi Sasada)
----------------------------------------
Trivial proposal.
Now `Ractor#[]/#[]=` is supported to access current ractor local storage. However, it doesn't allow to access local storage of other ractors.
```ruby
Ractor.current[:foo] = 1
Ractor.new{
p Ractor.main[:foo] #=> nil
}.take
```
So providing `Ractor.[]/[]=` is more reasonable.
Further more, we don't need to use `Ractor#current` and it is slightly faster.
--
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/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-06 19:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-05 2:35 [ruby-core:119050] [Ruby master Feature#20715] `Ractor.[]` and `Ractor.[]=` to access Ractor local storage ko1 (Koichi Sasada) via ruby-core
2024-09-06 15:38 ` [ruby-core:119086] " Eregon (Benoit Daloze) via ruby-core
2024-09-06 19:13 ` [ruby-core:119090] " byroot (Jean Boussier) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).