Skip to content

preemptive scheduling #5731

@thestinger

Description

@thestinger

I'm sure this would be very hard to implement and wouldn't be a good thing for all Rust code, but it is possible so I'm opening up an issue as a reference. I don't think having the compiler automatically insert yields into most loops would ever be an acceptable performance hit, so this is another alternative.

In a world without preemption, you can avoid blocking other tasks by assigning threads to tasks with CPU-bound loops or manually inserting scheduler yields. The garbage collector is task-local, so it's not going to be as big of an issue as it is in Go where one task can block garbage collection for the entire process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-concurrencyArea: ConcurrencyE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions