Skip to content

Get transcoding to work across ractors by locking certain operations #13601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

luke-gruber
Copy link
Contributor

@luke-gruber luke-gruber commented Jun 12, 2025

Ex: str.encode and str.encode! work across ractors now.

The global table transcoder_table needs a lock around each st_lookup/st_insert, and it's a two-level
table so the second level also needs to be locked around insertion/deletion. In addition to this, the
transcoder entries (values in the second-level hash table) need to be locked around retrieving them and
loading them as they are loaded lazily.

The transcoding objects (Encoding::Converter) can't be made shareable, so their operations don't need to be locked.

@luke-gruber luke-gruber force-pushed the ractor_transcode_lock branch from 1f4242d to 1755423 Compare June 12, 2025 19:23

This comment has been minimized.

@luke-gruber luke-gruber force-pushed the ractor_transcode_lock branch 4 times, most recently from bfdaa5f to f7e5bce Compare June 25, 2025 17:36
@luke-gruber
Copy link
Contributor Author

@jhawthorn Ready for review 😅

@luke-gruber luke-gruber force-pushed the ractor_transcode_lock branch from f7e5bce to 6d1204a Compare June 26, 2025 17:01
Ex: `str.encode` and `str.encode!` work across ractors now.

The global table `transcoder_table` needs a lock around each st_lookup/st_insert, and it's a two-level
table so the second level also needs to be locked around insertion/deletion. In addition to this, the
transcoder entries (values in the second-level hash table) need to be locked around retrieving them and
loading them as they are loaded lazily.

The transcoding objects (`Encoding::Converter`) can't be made shareable, so their operations don't need to be locked.
@luke-gruber luke-gruber force-pushed the ractor_transcode_lock branch from 6d1204a to 725a02d Compare June 26, 2025 17:23
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