I think you have a misunderstanding of threading.
Lets define a Thread:
Thread
A thread is the entity within a process that can be scheduled for execution. All threads of a process share its virtual address space and system resources. In addition, each thread maintains exception handlers, a scheduling priority, thread local storage, a unique thread identifier, and a set of structures the system will use to save the thread context until it is scheduled. The thread context includes the thread's set of machine registers, the kernel stack, a thread environment block, and a user stack in the address space of the thread's process. Threads can also have their own security context, which can be used for impersonating clients.
When you run a method inside a Thread
in your application, may it be a Background Thread
or a Foreground Thread
, you are executing a unit of work in parallel to the applications Main Thread
, which in your case is the UI Thread
of your GUI.
"How can I make it so it calls only the method from the active thread?
"
When you start a Thread
, it runs until it has finished execution (either by finishing work or terminating due to an exception or thread abortion). So when you start multiple threads simultaneously, invoking same method, they will all run it at the same time, since they are all active
You can use Concurrent Collections
which let you access collections inside a multithreaded environment
I suggest you read more about processes and threads here and here