i have a windows service written in .net 4 which doing jobs periodically using Threads. the server has more than 20 cpu core.
i create 10 threads in my windows service. is it possible to assign each thread a cpu core?
The OS already does precisely that for you. It doesn't guarantee that each thread will stay on the same core forever (and in nearly all cases, there's no need for that either), but it does try to keep as many cores busy as possible. Which means giving all available threads their own core as much as possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With