mmtk-core icon indicating copy to clipboard operation
mmtk-core copied to clipboard

Confusing name: scan_thread_roots

Open wks opened this issue 3 years ago • 1 comments

In the Scanning trait, there are two methods:

  • scan_thread_roots scans all roots in all threads.
  • scan_thread_root scans all roots in one thread.

The names are confusing because the plural is on the word "root", while the word "thread" is always singular.

And although "thread" is a noun, it can be an attributive noun. So "thread roots" can refer to any root as long as it is from any thread. This makes scan_thread_roots ambiguous: it may mean (a) "scan one thread for its roots", and (b) "scan all 'thread roots' which may be on any thread".

Suggested change:

  • scan_all_threads_for_roots
  • scan_thread_for_roots

or

  • scan_all_threads
  • scan_thread

or

  • scan_roots_in_all_threads
  • scan_roots_in_thread

or

  • scan_roots_all_threads
  • scan_roots_one_thread

wks avatar May 26 '22 12:05 wks

I like the third option best (scan_roots_in_all_threads, scan_roots_in_thread).

k-sareen avatar May 31 '22 06:05 k-sareen