39 if (queues.Length == 0)
54 if (num == queues.Length - 1)
68 internal volatile object[]
m_array =
new object[32];
84 bool lockTaken =
false;
103 if (num ==
int.MaxValue)
113 bool lockTaken =
false;
121 object[]
array =
new object[m_array.Length << 1];
122 for (
int i = 0; i <
m_array.Length; i++)
146 bool lockTaken =
false;
151 if (num ==
int.MaxValue)
178 bool lockTaken =
false;
241 bool lockTaken =
false;
247 int num2 = tailIndex &
m_mask;
275 bool lockTaken =
false;
285 int num = headIndex &
m_mask;
336 num += workStealingQueue.
Count;
430 public void Enqueue(
object callback,
bool forceGlobal)
441 if (threadPoolWorkQueueThreadLocals !=
null)
464 int num = queues.Length;
466 uint num3 = tl.
random.NextUInt32() % (uint)num;
469 num3 = ((num3 < num2) ? (num3 + 1) : 0u);
471 if (workStealingQueue2 != workStealingQueue && workStealingQueue2.
CanSteal)
473 result = workStealingQueue2.
TrySteal(ref missedSteal);
501 currentThread._executionContext =
null;
502 currentThread._synchronizationContext =
null;
509 bool missedSteal =
false;
510 obj = threadPoolWorkQueue.
Dequeue(orCreateThreadLocals, ref missedSteal);
539 if ((uint)(tickCount - num) >= 30u)
585 task.ExecuteFromThreadPool(currentThread);
int IList. IndexOf(object value)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
bool TryDequeue([MaybeNullWhen(false)] out T result)
static readonly FrameworkEventSource Log
static int ProcessorCount
static byte Max(byte val1, byte val2)
static void ResetThreadPoolThread(Thread currentThread)
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)
readonly ThreadPoolWorkQueue.WorkStealingQueue workStealingQueue
static ThreadPoolWorkQueueThreadLocals threadLocals
readonly Thread currentThread
readonly Random.XoshiroImpl random
readonly object threadLocalCompletionCountObject
static void Remove(WorkStealingQueue queue)
static void Add(WorkStealingQueue queue)
static volatile WorkStealingQueue[] _queues
static WorkStealingQueue[] Queues
bool LocalFindAndPop(object obj)
int LocalPush_HandleTailOverflow()
volatile object[] m_array
object TrySteal(ref bool missedSteal)
void LocalPush(object obj)
void RefreshLoggingEnabled()
void EnqueueTimeSensitiveWorkItem(IThreadPoolWorkItem timeSensitiveWorkItem)
static void DispatchWorkItem(object workItem, Thread currentThread)
void Enqueue(object callback, bool forceGlobal)
CacheLineSeparated _separated
readonly ConcurrentQueue< IThreadPoolWorkItem > timeSensitiveWorkQueue
object Dequeue(ThreadPoolWorkQueueThreadLocals tl, ref bool missedSteal)
static bool LocalFindAndPop(object callback)
void MarkThreadRequestSatisfied()
void RefreshLoggingEnabledFull()
readonly ConcurrentQueue< object > workItems
IThreadPoolWorkItem TryDequeueTimeSensitiveWorkItem()
static void DispatchWorkItemWithWorkerTracking(object workItem, Thread currentThread)
void EnsureThreadRequested()
ThreadPoolWorkQueueThreadLocals CreateThreadLocals()
ThreadPoolWorkQueueThreadLocals GetOrCreateThreadLocals()
static bool SupportsTimeSensitiveWorkItems
static readonly ThreadPoolWorkQueue s_workQueue
static bool EnableWorkerTracking
static void ReportThreadStatus(bool isWorking)
static bool NotifyWorkItemComplete(object threadLocalCompletionCountObject, int currentTimeMs)
static void RequestWorkerThread()
void ResetThreadPoolThread()
static bool Read(ref bool location)
static void Write(ref bool location, bool value)
void TryEnter(ref bool lockTaken)
void Enter(ref bool lockTaken)
readonly PaddingFor32 pad1
readonly PaddingFor32 pad2
volatile int numOutstandingThreadRequests