I have been running some computationally-intensive processes (compiling and linking large programs) in WSL2 on Windows 10 Pro (build 19041.746), and doing so noticably slows down graphical Windows programs, sometimes seeming to halt them altogether for a minute or more.
I have been setting the -j option of the make job that runs these processes to 1, to minimize parallelism, and I am also using ‘nice’ to reduce the priority of these processes within Linux. While this allows me to run other Linux programs concurrently in WSL2, it does not seem to ameliorate the impact on Windows programs (which is to be expected, I suppose, as the Linux scheduler presumably does not ‘know’ about what is happening in its Windows host.)
I went into the Windows Task Manager and found two instances of wsl.exe and three instances of wslhost.exe running (corresponding to one terminal with two tabs open.) I set all their priorities to ‘low’ and restarted the Linux job in one of those terminal tabs, but at best this only slightly improved the situation. Given that the Linux programs do not seem to be slowed down much by what I have done so far, it seems there might be room for the Windows performance to be restored while the Linux programs continue to make progress (I do not care if they are slower, within reason), but is there anything I can do to achieve that?