Go to: Synopsis. Return value. Flags. MEL examples.

Synopsis

threadCount [-numberOfThreads int]

threadCount is undoable, queryable, and NOT editable.

This command sets the number of threads to be used by Maya in regions of code that are multithreaded. By default the number of threads is equal to the number of logical CPUs, not the number of physical CPUs. Logical CPUs are different from physical CPUs in the following ways:

A physical CPU with hyperthreading counts as two logical CPUs
A dual-core CPU counts as two logical CPUs

With some workloads, using one thread per logical CPU may not perform well. This is sometimes the case with hyperthreading. It is worth experimenting with different numbers of threads to see which gives the best performance. Note that having more threads can mean Maya uses more memory.

Setting a value of zero means the number of threads used will equal the number of logical processors in the system.

Return value

None

In query mode, return type is based on queried flag.

Flags

numberOfThreads
Long name (short name) Argument types Properties
-numberOfThreads(-n) int createquery
Sets the number of threads to use

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

threadCount -n 4;    // sets Maya to use 4 threads for multithreaded evaluation
threadCount -n 0;    // sets Maya to use one thread per logical CPU
threadCount -q -n;   // query number of threads currently set