Skip to content
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

Should RubySingleThreadExecutor be marked to be a SerialExecutorService again? #1069

Open
meineerde opened this issue Nov 1, 2024 · 2 comments · May be fixed by #1070
Open

Should RubySingleThreadExecutor be marked to be a SerialExecutorService again? #1069

meineerde opened this issue Nov 1, 2024 · 2 comments · May be fixed by #1070

Comments

@meineerde
Copy link
Contributor

In 455203e, the RubySingleThreadExecutor implementation was updated to use the generic RubyThreadPoolExecutor. With that change, the previously included SerialExecutorService module was removed, resulting in RubySingleThreadExecutor#serialized? now returning false.

I'm wondering if that is actually correct, given that we still have exactly one thread which executes a single task at a time which is pop'ed from the queue serially?

Shouldn't the module be included again, or more generally: shouldn't RubyThreadPoolExecutor#serialized? always return true if its max_threads is <= 1?

@meineerde
Copy link
Contributor Author

Conversely, in case I'm mistaken and RubySingleThreadExecutor is in fact not serialized?, its documentation should probably be amended to explain why.

@bensheldon
Copy link
Contributor

I think you're correct that SerialExecutorService shouldn't have been removed. The Java implementation does include the module:

Could you make a PR for that?

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 a pull request may close this issue.

2 participants