-
Notifications
You must be signed in to change notification settings - Fork 146
/
DispatcherKind.cs
99 lines (85 loc) · 2.79 KB
/
DispatcherKind.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace BuildXL.Scheduler.WorkDispatcher
{
/// <summary>
/// Dispatcher queue kinds
/// </summary>
public enum DispatcherKind
{
/// <summary>
/// None as a default kind
/// </summary>
None,
/// <summary>
/// IO queue for IO-bound operations
/// </summary>
/// <remarks>
/// The queue where CopyFile and WriteFile pips run
/// </remarks>
IO,
/// <summary>
/// CPU queue for CPU-bound operations
/// </summary>
/// <remarks>
/// The queue where SealDirectory, Process (if pipelining disabled), meta pips, process executions (if pipelining enabled) run.
/// </remarks>
CPU,
/// <summary>
/// Light queue for lightweight operations
/// </summary>
Light,
/// <summary>
/// Ipc queue for Ipc pips
/// </summary>
IpcPips,
/// <summary>
/// Cache lookup queue
/// </summary>
/// <remarks>
/// The queue where process pips do cache lookup.
/// </remarks>
CacheLookup,
/// <summary>
/// Choose worker queue for CPU queue
/// </summary>
ChooseWorkerCpu,
/// <summary>
/// Choose worker queue for CacheLookup queue
/// </summary>
ChooseWorkerCacheLookup,
/// <summary>
/// Choose worker queue for IPC pips
/// </summary>
ChooseWorkerIpc,
/// <summary>
/// Choose worker queue to find a worker to execute light process pips
/// </summary>
ChooseWorkerLight,
/// <summary>
/// Delayed cache lookup queue
/// </summary>
/// <remarks>
/// If the delayed cache lookup feature is enabled, pips are parked in this queue
/// if ChooseWorkerCpu already contains enough pips waiting.
/// </remarks>
DelayedCacheLookup,
/// <summary>
/// Queue for input/output materialization
/// </summary>
Materialize,
}
/// <summary>
/// Extension methods for <see cref="DispatcherKind"/>
/// </summary>
public static class DispatcherKindHelpers
{
/// <summary>
/// Whether this dispatcher represents a logic for choosing a worker.
/// </summary>
public static bool IsChooseWorker(this DispatcherKind kind)
{
return kind == DispatcherKind.ChooseWorkerLight || kind == DispatcherKind.ChooseWorkerCacheLookup || kind == DispatcherKind.ChooseWorkerCpu || kind == DispatcherKind.ChooseWorkerIpc;
}
}
}