From: "ioquatix (Samuel Williams) via ruby-core" Date: 2023-02-25T02:55:35+00:00 Subject: [ruby-core:112586] [Ruby master Feature#19440] Deprecate ThreadGroup Issue #19440 has been updated by ioquatix (Samuel Williams). I don't think I have ever seen ThreadGroup used in practice, nor do I personally know why I'd want to use it. Therefore, I'd be okay with deprecating it. '' ---------------------------------------- Feature #19440: Deprecate ThreadGroup https://bugs.ruby-lang.org/issues/19440#change-102034 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal ---------------------------------------- I looked at the ThreadGroup methods, and none of them seem really useful. `enclose` has super confusing semantics, in that it surprisingly allows creating new threads from a thread already in that group, but forbids `#add`. So the new thread is not the same as "adding" a thread, very confusing. This weird restriction results for instance in `Timeout` not being able to move the Thread it creates to the default ThreadGroup: https://github.com/ruby/timeout/issues/24 And there is also no method to create a Thread in the given ThreadGroup. `add` and `list` could just be simulated with an Array. Maybe it's time we deprecate ThreadGroup or at least `enclose`/`enclosed?` since those seem to have unusable/useless semantics? If not, how do we cleanly solve https://github.com/ruby/timeout/issues/24? -- 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/