Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
System.Threading.PortableThreadPool Class Referencesealed

Classes

class  BlockingConfig
 
struct  CacheLineSeparated
 
struct  CountsOfThreadsProcessingUserCallbacks
 
struct  CpuUtilizationReader
 
class  GateThread
 
class  HillClimbing
 
struct  ThreadCounts
 
class  WaitThread
 
class  WaitThreadNode
 
class  WorkerThread
 

Public Member Functions

bool SetMinThreads (int workerThreads, int ioCompletionThreads)
 
int GetMinThreads ()
 
bool SetMaxThreads (int workerThreads, int ioCompletionThreads)
 
int GetMaxThreads ()
 
int GetAvailableThreads ()
 
object GetOrCreateThreadLocalCompletionCountObject ()
 
bool NotifyThreadBlocked ()
 
void NotifyThreadUnblocked ()
 
void ReportThreadStatus (bool isProcessingUserCallback)
 

Static Public Attributes

static readonly PortableThreadPool ThreadPoolInstance = new PortableThreadPool()
 

Package Functions

void NotifyWorkItemProgress ()
 
bool NotifyWorkItemComplete (object threadLocalCompletionCountObject, int currentTimeMs)
 
void RequestWorker ()
 
void RegisterWaitHandle (RegisteredWaitHandle handle)
 

Static Package Functions

static void EnsureGateThreadRunning ()
 
static void CompleteWait (RegisteredWaitHandle handle, bool timedOut)
 

Properties

int ThreadCount [get]
 
long CompletedWorkItemCount [get]
 
short MinThreadsGoal [get]
 
short TargetThreadsGoalForBlockingAdjustment [get]
 

Private Types

enum  PendingBlockingAdjustment : byte { None , Immediately , WithDelayIfNecessary }
 

Private Member Functions

 PortableThreadPool ()
 
object CreateThreadLocalCompletionCountObject ()
 
void NotifyWorkItemProgress (object threadLocalCompletionCountObject, int currentTimeMs)
 
void AdjustMaxWorkersActive ()
 
bool ShouldAdjustMaxWorkersActive (int currentTimeMs)
 
bool OnGen2GCCallback ()
 
uint PerformBlockingAdjustment (bool previousDelayElapsed)
 
uint PerformBlockingAdjustment (bool previousDelayElapsed, out bool addWorker)
 
bool TryRemoveWaitThread (WaitThread thread)
 
void RemoveWaitThread (WaitThread thread)
 
short GetAndResetHighWatermarkCountOfThreadsProcessingUserCallbacks ()
 

Private Attributes

int _cpuUtilization
 
short _minThreads
 
short _maxThreads
 
long _currentSampleStartTime
 
readonly ThreadInt64PersistentCounter _completionCounter = new ThreadInt64PersistentCounter()
 
int _threadAdjustmentIntervalMs
 
short _numBlockedThreads
 
short _numThreadsAddedDueToBlocking
 
PendingBlockingAdjustment _pendingBlockingAdjustment
 
long _memoryUsageBytes
 
long _memoryLimitBytes
 
readonly LowLevelLock _threadAdjustmentLock = new LowLevelLock()
 
CacheLineSeparated _separated
 
WaitThreadNode _waitThreadsHead
 
readonly LowLevelLock _waitThreadLock = new LowLevelLock()
 
CountsOfThreadsProcessingUserCallbacks _countsOfThreadsProcessingUserCallbacks
 

Static Private Attributes

static readonly short ForcedMinWorkerThreads = AppContextConfigHelper.GetInt16Config("System.Threading.ThreadPool.MinThreads", 0, allowNegative: false)
 
static readonly short ForcedMaxWorkerThreads = AppContextConfigHelper.GetInt16Config("System.Threading.ThreadPool.MaxThreads", 0, allowNegative: false)
 
static object t_completionCountObject
 

Detailed Description

Definition at line 10 of file PortableThreadPool.cs.


The documentation for this class was generated from the following file: