I'm trying to understand the code below, but to no avail.
From what I've researched, GetMaxThreads
returns the maximum number of available threads and GetAvailableThreads
what it has available. In the case of the output below, is there no more threads available? What does .Net C # do in this situation?
int threads;
int disponiveis;
int dummy;
long consultas = Interlocked.Read(ref _threads);
ThreadPool.GetMaxThreads(out threads, out dummy);
ThreadPool.GetAvailableThreads(out disponiveis, out dummy);
_gerenciador.Log(String.Format("Status dos threads: Consultas {0}, Threads: {1}, Disponíveis: {2}", consultas, threads, disponiveis));
Output:
Status dos threads: Consultas 2, Threads: 1023, Disponíveis: 1020