Creating dynamic threads for a SMS text API
static public BlockingCollection&lt;int&gt; Queue
static public BlockingCollection&lt;int&gt; Finished
static public BlockingCollection&lt;Thread&gt; Threads
static public int QUCount
static public int THCount
static public int FNCount


There is no need to make any of these fields public. You shouldn't change the visibility from the default of private unless you have a reason to do it.

for (long i = 0; i &lt; 5000; i++)
{
    Random RandomNum = new Random();
    int Num = RandomNum.Next(1, 2);
    Queue.Add(Num);
}


This is a very complicated way to generate 5000 1s. If you actually want to generate random numbers, you can't create a new Random for each iteration, you should instead create it once before the loop and then just call Next() inside it. That's because Random is initialized by the current time by default, and the time as measured by .Net doesn't change that often. That means you would get runs of the same number, which is not random.

THCount = Threads.Count;
FNCount = Finished.Count;


These lines don't do anything here, both collections are going to be empty at this point. In fact, the Count fields are completely useless, you should just use the Count property of each collection instead.

while (QUCount &gt; 0)
{
    if (THCount &lt; 20)
    {
        Thread th1 = new Thread(LoopMethod);
        th1.Start();
    }
}


This code doesn't make much sense. It's certainly possible that it will start all 20 threads even if there's just a single item in the queue, because you could create all of the threads before the first one starts.

What's much worse is that it will keep on iterating while the other threads are working. This means a whole single core of your CPU will be fully busy, doing basically nothing.

Thread th1 = new Thread(LoopMethod);


Threads are relatively heavy-weight, you should usually create a new thread only for a long running operation. If you have thousands of operations, you shouldn't create thousands of threads. Instead, you should create just a few of them and have a loop inside each.

Threads.Add(th1);


There is no need to do this. You don't actually need a collection of threads, you just need to know their count. So you should use an int field for that, and increment that value in a thread-safe manner.

Thread CurTh = Thread.CurrentThread;
Threads.TryTake(out CurTh);


This code looks like it's trying to take the current thread out of the collection. In fact, it does no such thing. Instead, it removes the first item from the collection (i.e. the oldest item that hasn't yet been removed from the collection) and assigns that to the CurTh variable. The out modifier means, among other things, that the parameter is used for output only and if it has some value before the method is called, it's going to be ignored.

int QUCount
int THCount
int FNCount
Thread th1


You shouldn't abbreviate your field and variable names like this. You should write their names in full, (e.g. QueueCount or thread), because code is read more often than it is written, so it makes sense to strive for code that is easy to read, not code that is easy to write. (And it doesn't even make much difference with autocompletion.)



Usually, it's much better to use TPL for parallel processing, instead of manually using threads. Using GetConsumingEnumerable() and Parallel.ForEach() would make your code shorter, more readable and much more efficient. (CPU efficiency usually doesn't matter much for code like this, but you're wasting CPU a lot.)

class Program
{
    static BlockingCollection&lt;int&gt; Queue = new BlockingCollection&lt;int&gt;();
    static BlockingCollection&lt;int&gt; Finished = new BlockingCollection&lt;int&gt;();

    static void Main()
    {
        BuildList();

        Parallel.ForEach(
            Queue.GetConsumingEnumerable(),
            new ParallelOptions { MaxDegreeOfParallelism = 20 },
            ProcessItem);
    }

    static void ProcessItem(int i)
    {
        int result = /* somehow calculate the result here */;
        Finished.Add(result);
    }
}


(I have also removed your logging for brevity.)