All help topics · Link to this topic
Showing help on 'thread_pool()'
Syntax: thread_pool(STR <function>, STR <pool> [, INT <value>])This function allows you to control any thread pools that the server created at startup. It should be used with care, as it has the potential to create disasterous consequences if used incorrectly.
The <function> parameter is the function you wish to perform on the thread pool. The functions available are:
INIT: Control initialization of a thread pool.
The <pool> parameter controls which thread pool you wish to apply the designated function to. At the time of writing, the server creates the following thread pool:
MAIN: The main thread pool where threaded built-in function work takes place.
Finally, <value> is the value you want to pass to the <function> of <pool>. The following functions accept the following values:
INIT: The number of threads to spawn. NOTE: When executing this function, the existing <pool> will be destroyed and a new one created in its place.
Examples:
;thread_pool("INIT", "MAIN", 1) => Replace the existing main thread pool with a new pool consisting of a single thread.