I wouldn't bother unless you have a very specific issue which you know is solved by this. (And if you have to ask, you probably don't.)
Modern OSs are quite good at distributing threads around CPU cores to balance the workload well and avoid overworking individual cores, plus your code is not going to be the only running code that needs to use CPU cores. Threads in your drivers, in any libraries you use, and in other programs or background processes will also need CPU time, and you certainly don't have knowledge of exactly what is going on there. You don't want to be at the risk of starving your GPU's driver of the CPU time it needs just because you were greedy with your own code, do you?
For example, and just to illustrate, here's a Task Manager shot of a single-threaded game running on Windows 10:
Bearing in mind the usual caveats about Task Manager as a profiling tool, we can nonetheless make a few observations.
- The game itself is single-threaded (and, in fact, runs flat-out).
- At no stage is any CPU core pegged at 100% usage.
- Average CPU usage exceeds 25% (not visible in this shot, it was 35%).
- So over 4 cores we can roughly say that 25% was the game running flat-out and 10% was other work.
- And the OS nicely moved the work around cores to keep the system running well.