Skip to content

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

Open
@meineerde

Description

@meineerde
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?

Activity

meineerde

meineerde commented on Nov 1, 2024

@meineerde
ContributorAuthor

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

bensheldon

bensheldon commented on Nov 1, 2024

@bensheldon
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @bensheldon@meineerde

      Issue actions

        Should RubySingleThreadExecutor be marked to be a SerialExecutorService again? · Issue #1069 · ruby-concurrency/concurrent-ruby