-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.
Description
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
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyE-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.