I have a Windows OS, with a WSL installed. I am running some computation heavy processes in WSL, written in Fortran, submit using nohup, which usually takes 10 hours to complete a task.

I wanted to simultaneously submit, say 30 tasks. But I want to leave at least one core (or thread) free for my windows processes (like my browser and OriginPro).

Is there a way to submit jobs in WSL that limit to only n-1 number of cores/threads? Or even better, prioritize windows tasks so that my WSL processes gets the lowest priority (similar to nice).


2023-03-15: Post forwared from AskUbuntu.

The problem is, I only have one computer. Sometimes I submit a whole bunch of jobs at once in WSL and let it run non-stop for a few weeks. And during this time, I want to use Windows to do something else during the day, but it is extremely slow, and I want to prioritize those Windows apps to run faster. But at the same time, I want the PC to run at full power on those WSL jobs when I go home at night.

  • you could of course limit the number of processors available to WSL Mar 15 at 6:17
  • @JaromandaX, thanks. That's one way to do it. But processor limitation is only available to WSL2 and not WSL1. Also, when I'm not running Win apps, those limited processors will be idle. Mar 15 at 6:41
  • true - does each task use more than one cpu core/cpu thread? Mar 15 at 7:46
  • @JaromandaX each task is running on a single core/thread. Mar 15 at 8:18
  • 1
    You could lower the priority of these WSL tasks so they stay in the background. How do these tasks look like in Task Manager? Do they all use the same .exe?
    – harrymc
    Mar 15 at 10:00


You must log in to answer this question.