-
Notifications
You must be signed in to change notification settings - Fork 347
Scheduler improvements #2026
Scheduler improvements #2026
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,11 @@ namespace System.Threading | |
{ | ||
public abstract class Scheduler | ||
{ | ||
public static Scheduler TaskRun { get; } = new TaskRunScheduler(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because you said so here #2026 (review) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should have been more specific, why the syntax change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Storing it in a Scheduler.ThreadPool.Schedule((() => {}) So it remains a virtual call. Storing it in an exact type field Won't directly help pipelines as the |
||
public static Scheduler Inline { get; } = new InlineScheduler(); | ||
private static TaskRunScheduler _taskRunScheduler = new TaskRunScheduler(); | ||
private static InlineScheduler _inlineScheduler = new InlineScheduler(); | ||
|
||
public static Scheduler TaskRun => _taskRunScheduler; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ThreadPool There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
public static Scheduler Inline => _inlineScheduler; | ||
|
||
public abstract void Schedule(Action action); | ||
public abstract void Schedule(Action<object> action, object state); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably the most unfortunate part of this change but meh..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh indeed. It's in implementation details with zero bearings on the user's experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case yes.