Skip to content

[RFC] Frame Scoped Lifetime for In Frame Temperary Refs #3970

Open

Description

@qingshi163

Summary

for some mutex or rwlock we can use atomic CAS operations instead if we can garentee the clearup within frame lifetime

Detailed Explanation

For example PyObject hold a PyTypeRef witch is protected by a rwlock, we could replace the lock with a atomic CAS operations
then hold the old PyRef until the current frame is done. Also we need to garentee no reference to be keep across the frames.

Drawbacks, Rationale, and Alternatives

Unresolved Questions

should we use rust lifetime system or just the coding rules to make the garrentee?
where should the lifetime placed? with VirtualMachine or the struct wrap the VirtualMachine or seperate parameter?

Activity

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

    RFCRequest for comments

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions