Reference 》 ArcaletThreadPool 》 Method
Method
Compared to .Net Framework, it is a higher performance and more stable system thread pool. When the backgound work process is shorter, and there is a lot of demand in background work in a short time, Arcale system ThreadPool will not generate a large number of threads that are generated and destroyed. Avoid DP working over a long period of time so that the new processing threads' generation will not be delayed when it is in Garbage Collection. If the background work for high immediacy requiremen has a higher demand, this delay will have great impact on the service.
public static void QueueUserWorkItem(WaitCallback callback, object state)
callback The name of method for work to be performed state The parameter of work to be performed This usage of method is completely compatible with QueueUserWorkItem()in the .Net Framework
public static void QueueUserWorkItem(WaitCallback callback)
callback The name of method for work to be performed This usage of Method is completely compatible with QueueUserWorkItem()in the .Net Framework.
public static int GetAvailableThreads()
The amount of the processing threads that are accessible is calculated by subtracting the maximum processing threads from the ones in use. This usage of method is completely compatible with QueueUserWorkItem()in Net Framework
public static int GetQueuedUserWorkItems()
In the process of getting the processing threads in the thread pool. Wait for the amount of the processing threads to be used.
public static int GetWorkerThreads()
Get the number of the processing threads in the idle thread pool operating currently.
public static int GetSuspendedThreads()
Get the number of the current processing threads in idle thread pool.
public static bool SetMaxThreads(int workerThreads)
workerThreads Set the maximum number of the processing threads in the thread pool. This function is to allow DP Developers to optimize their game's features. Generally speaking, developers do not need much adjustment. Please note that more processing threads don't mean better efficiency. Adjusting the value too high will cause a huge amount of processing threads to be generated and destroyed and thus affect the stability of DP.
public static bool SetMinThreads(int workerThreads)
workerThreads Set the minimum number of the processing threads in the thread pool. This function allows DP Developers to optimize their game's features. Generally speaking, developers do not need much adjustment.
public static bool SetThreadTTL(int workerSeconds)
workerSeconds Set the longest number of survival seconds for the processing threads in the thread pool. When the threads are processing longer than the time, they will be removed from the thread pool. This function is to allow DP Developers to optimize their game's features. Generally speaking, developers do not need much adjustment. Adjusting the value too low will lead to a huge amount of processing threads to be generated and destroyed and thus affect the stability of DP.
Was this page helpful?
Yes
No