I developed a multi threaded application. The main thread takes huge resources while the other threads are lighter.
Now I want to make it work like this on a multicore/processor computer
The main thread => second processor
All other thread => first processor
I am using System.Threading to create and launch the threads. However through a Thread reference I can only access the managedThreadID and not the real ID which is found in Process.GetCurrentProcess().Threads[] . I also cannot use processorAffinity either since System.Threading.Thread does not have this attribute.
So I have to list the thread in my process and then affect the affinity. However ID's in the list of threads in the process are not the same as the managed ID.
Am I doing it totally wrong Does a function exists which can identify an ID from the managed thread pool with the thread ID of the process thread list
I do have a solution to know which threads has which ID, by listing all the threads in the process list, saving the ID list, launch a thread, find the ID which differed and that would by the ID of my thread.
I was just wondering if something simplier existed and if I did things kinda right or not
Regards,
Chryso