getNumThreads function

Number of available threads