Skip to content

[Feature] More fine-grained GIL locking #24

@ccollie

Description

@ccollie

The problem/use-case that the feature addresses

The metadata commands (TS.QUERYINDEX, TS.CARD, TS.LABELNAMES, TS.LABELVALUES, TS.STATS) access data external to the Valkey database. However fanout commands generate responses using a locked Context. Additionally, commands which construct output in stages could benefit from more fine-grained locking.

Description of the feature

In those cases, we should use the ability to generate the reply without holding the GIL.

Alternatives you've considered

Any alternative solutions or features you've considered, including references to existing open and closed feature requests in this repository.

Additional information

For fanout, our internal state maintains a ThreadSafeContext with a blocked client. When calling FanoutOperation::generate_reply, we lock the thread context and return the returned Context. We could instead return the ThreadSafeContext, or better yet, encapsulate it in a newtype with reply methods (which do not require a lock).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions