So, I'm currently working on a project that takes time when certain processes are running. I am trying to figure out the most efficient way to scan a list of processes, and then check the names of the process executables in the list of supported programs.
Essentially, the problem consists of two parts:
1) The most efficient way to get process executable names from a process list
2) The most effective way to compare this list with another list
For (1), one of the other developers played using the tasklist command and parsed the executable names. I also found out that C # has a list of System.Diagnostic processes that will do this automatically. We are still trying to solve between Java and C #, so I am probably leaning towards a language neutral solution, but this may be the deciding factor for C #.
For (2), the supported list of processes can be small on average (1-10 process names). We could just start each process on the list, but we thought that it could be too much for older PCs, so we gave up the idea of ββcreating an alphabetically balanced AVL tree containing the initial list of processes when the application starts, and checking everything against it first, and then check our list of supported process names if it is not in the tree.
Any suggestions are welcome.
Edit: Obviously, you can filter the task list by the name of the executable, so we could just do this for each process in the list of supported processes.
Edit 2: Is there an equivalent task list that works for Windows XP Home?
source
share