Skip to content

Conversation

@ko1
Copy link
Contributor

@ko1 ko1 commented Apr 16, 2022

Now GVL is not process Global so this patch try to use
another words.

  • rb_global_vm_lock_t -> struct rb_thread_sched
    • gvl->owner -> sched->running
    • gvl->waitq -> sched->readyq
  • rb_gvl_init -> rb_thread_sched_init
  • gvl_destroy -> rb_thread_sched_destroy
  • gvl_acquire -> thread_sched_to_running # waiting -> ready -> running
  • gvl_release -> thread_sched_to_waiting # running -> waiting
  • gvl_yield -> thread_sched_yield
  • GVL_UNLOCK_BEGIN -> THREAD_BLOCKING_BEGIN
  • GVL_UNLOCK_END -> THREAD_BLOCKING_END

and

  • removed
    • rb_ractor_gvl
    • rb_vm_gvl_destroy (not used)

There are GVL functions such as rb_thread_call_without_gvl() yet
but I don't have good name to replace them. Maybe GVL stands for
"Greate Valuable Lock" or something like that.

@ko1 ko1 force-pushed the rename_gvl branch 2 times, most recently from b71f3d4 to bdefe25 Compare April 19, 2022 09:30
Now GVL is not process *Global* so this patch try to use
another words.

* `rb_global_vm_lock_t` -> `struct rb_thread_sched`
  * `gvl->owner` -> `sched->running`
  * `gvl->waitq` -> `sched->readyq`
* `rb_gvl_init` -> `rb_thread_sched_init`
* `gvl_destroy` -> `rb_thread_sched_destroy`
* `gvl_acquire` -> `thread_sched_to_running` # waiting -> ready -> running
* `gvl_release` -> `thread_sched_to_waiting` # running -> waiting
* `gvl_yield`   -> `thread_sched_yield`
* `GVL_UNLOCK_BEGIN` -> `THREAD_BLOCKING_BEGIN`
* `GVL_UNLOCK_END` -> `THREAD_BLOCKING_END`

* removed
  * `rb_ractor_gvl`
  * `rb_vm_gvl_destroy` (not used)

There are GVL functions such as `rb_thread_call_without_gvl()` yet
but I don't have good name to replace them. Maybe GVL stands for
"Greate Valuable Lock" or something like that.
@ko1 ko1 changed the title WIP rename thread internal naming Apr 21, 2022
@ko1 ko1 marked this pull request as ready for review April 21, 2022 16:52
@ko1 ko1 merged commit 1c4fc02 into ruby:master Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant