By definition, Windows is a multitasking operating system. That is, several tasks can be performed in it simultaneously. However, the task is different. And the difference lies in priority. That is, when executing a program, Windows distributes resources in a certain way, depending on the priority of which process (program). In the future I will call programs processes, it’s easier. Every running program in Windows is a process. Priorities are different - big, small, but more on that later. How can this help us? Here's what. Many people complain about the slow execution of Vb programs. At one time I came across this with the most obvious example. Imagine a program that must perform some action at a certain time interval - for example, display something to the user. Simple, you say. Take a timer and go ahead. What if, in addition to this, the program must periodically count something else, and more than once, and there are many timers? It will slow down. And not Windows, but only the program. Not fair? Yes. This means that Windows allocates few resources to your program, which are clearly not enough for it. So ask Windows for more, but how?
So we need to change the priority. It's time to talk about them. In Windows "98 there are fewer priorities than in Windows Me or 2000, but they still exist. Here they are.
Real time priority - the program runs as if it alone were the purpose of Windows. All resources are given to her.
High priority (high) - the program is executed in such a way as to leave a little time for other applications.
Normal - execution proceeds in the usual way.
Low (idle) - if execution occurs, it is only when Windows has nothing to do.
Well, the running program first receives Normal priority and runs as usual. With this priority, no matter what the program does, it will not be able to consume so many resources that Windows will hang. In theory. But that doesn't suit us. We need high priority or, if everything is very stressful, real time. But real time is a dangerous thing. Even a mouse can easily slow down. And I don’t want to talk about the rest of the programs. It's just a bummer and that's all. So, how can you change the priority?
Yes, the SetPriorityClass function is responsible for setting the priority. That is, by calling it and passing everything it needs, we will receive the desired priority.
Private Declare Function SetPriorityClass _ Lib "kernel32" (ByVal hProcess As Long, _ ByVal dwPriorityClass As Long) As Long
It's simple - take the constant and go ahead, but we need to get the Handle of the process. That is, process and window for Windows are almost synonymous things, but not always. Window Handle is one thing, Process Handle is completely different. That is, a process can have many windows, but a window has only one process owner. This means that we need to learn how to find the Handle of the process itself. The OpenProcess function will help us with this; after passing parameters to it, it will tell us what Handle the process has.
Private Declare Function OpenProcess _ Lib "kernel32" (ByVal dwDesiredAccess As Long, _ ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
dwDesiredAccess - what we want to know (the Handle of a process is different, to end the process - one, to receive information - another). We will use the PROCESS_QUERY_INFORMATION constant, that is, query the process.
Private Const PROCESS_QUERY_INFORMATION = &H400
bInheritHandle is a Boolean variable. If you pass it True, then the resulting Handle can be used by another process in the future. But we don't need that. We pass False there.
DwProcessId - yes, and this is another thing - the identifier (id) of the process. We need to get it too. How? Just! The GetCurrentProcessId function, called without parameters (thank God), simply returns the id of the current process.
Private Declare Function GetCurrentProcessId _ Lib "kernel32" Alias "GetCurrentProcessId" () As Long
All. You can breathe and do everything beautifully.
Some code
Option Explicit Private Declare Function SetPriorityClass _ Lib "kernel32" (ByVal hProcess As Long, _ ByVal dwPriorityClass As Long) As Long Private Const REALTIME_PRIORITY_CLASS = &H100 Private Const HIGH_PRIORITY_CLASS = &H80 Private Const NORMAL_PRIORITY_CLASS = &H20 Private Const IDLE_PRIOR ITY_CLASS = &H40 Private Declare Function OpenProcess _ Lib "kernel32" (ByVal dwDesiredAccess As Long, _ ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Private Const PROCESS_QUERY_INFORMATION = &H400 Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long Private Sub SetPriority(Priority As Long) Dim ProcId As Long "variable for process id Dim ProcHandle As Long "variable for process handle ProcId = GetCurrentProcessId "get id ProcHandle = OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcId) "received Handle Call SetPriorityClass(ProcHandle, Priority) " set priority End Sub Private Sub Form_Load () "set the priority SetPriority HIGH_PRIORITY_CLASS End Sub
Instructions
Press the key combination “Ctrl+Alt+Delete”. A list of actions that can be performed will appear on the screen.
In the task manager window that opens, go to the “Applications” tab.
Select the program whose priority you want to change. Right-click on it and, in the drop-down menu, click on “Go to processes”. All programs that run on a computer have their own processes, and it is for them that priorities are set.
In the drop-down menu, set the priority to medium, high, low or other.
Helpful advice
You can view more information about the running process in the Task Manager. To do this, right-click on it and select the “Properties” command. The dialog box that appears displays details about the process, including its placement and size. Click the Details tab to view detailed information about the process.
The task manager can be launched by right-clicking on the taskbar and selecting “Task Manager” from the drop-down menu.
Sources:
Process scheduling in UNIX is based on priority. Typically each process has two priority attributes. There are 32 priority levels in Windows. On your computer, you can speed up the work of programs that are in the operating system. To do this, you just need to increase the priority of the process.
Instructions
You need to go to the "Task Manager". To do this, right-click on the “Taskbar” section. Select "Task Manager" from the context menu. Go to the “Processes” tab. There you will see a list of all running processes. Find the one you want and right-click on it. Next, select the “Priority” command. Now you can increase the priority of the process. "Task Manager" is possible.
You can also increase the priority using the InqSoft Speedballs utility. This monitors all processes. Launch it. Increasing process priority automatically. By going to Settings, you can change the settings. In the menu where it says “Increase priority to,” check the High box and click “Apply.”
In the Control Panel, go to the Settings section. Select Performance and Maintenance. Go to the System menu and switch to the Performance tab. Find the Application Performance section and use the arrow to set the desired process priority level.
You can increase the priority of a process in Linux as well. This is done through the console. Press the top command - text will appear in front of you. Now you can perform different actions. To increase the priority, press the r key on the keyboard.
If you need to increase the priority of a process in a game, do the following. For example, take the game World of Warcraft. Open through “Start”, then the “Notepad” program. Paste the following text: @echo off cd /d "C:/Program Files/World of Warcraft"start/high wow.exe. Change this path: "C:/Program Files/World of Warcraft" to the new one that you will have. Save the previously written text in Notepad in .bat format. Launch your game through this file. You will notice an increase in priority.
Sources:
No matter how powerful the reserve of resources your computer has, they are still not endless. A special OS component distributes RAM and graphics memory, priority and frequency of access to the processor, cache memory and some other resources between all running system and application programs. He does this in accordance with the priority table, which he himself compiles by default. The user has the opportunity to intervene in the distribution of the importance of running processes.
Instructions
Launch Windows Task Manager. This can be done in several ways - for example, by pressing the key combination Ctrl + Alt + Delete. In Windows 7, an additional menu appears on the screen in which you should select “Launch Task Manager”, but in earlier versions of Windows this intermediate step is not present. Another way to open the task manager is to open the program launch window by pressing the Win + R key combination, then entering the taskmgr command and clicking the OK button.
Right-click on the line with the desired process and expand the “Priority” section in the context menu. By default, all processes have "normal" priority - change this by selecting any of the six options listed. However, do not forget that in some cases, excessively increasing the priority of application programs (the “High” and “Real Time” items) can lead to a sluggish response of the operating system to keystrokes, mouse movements, etc. The same problem can also occur if the priority of system processes (for example, a process named explorer) is excessively lowered.
We use a dictionary. If programs are not closed, they use our computer's resource. You can see what is actually happening in a special Windows OS program. But not just look, but manage the distribution of resources in order to improve performance. Let's look at how to increase priority in the Windows Task Manager.
When working with many programs, the computer switches from one to another in a certain order. The ones he deems most important are executed first. The degree of importance is called priority. Typically, it is controlled by the program code itself. But the user can change the basic parameter to some other one, thereby making what is important to him at the moment faster.
The degree of importance has the following gradations:
Let's look at how to set priority in the Task Manager:
IMPORTANT. Remember that high values for one program can significantly reduce the performance of the machine as a whole. Increase gradually, and through experience, find the degree that will make the work comfortable.
When does this apply? Mainly for solving temporary tasks. For example, you are watching a movie and at the same time downloading some data from the Internet, and the video is periodically interrupted. Increasing the importance of the player will solve this problem. This is also often used to improve browser performance when browsing the Internet.
As already mentioned, the change is valid only for a certain point in time while the program is running. When it restarts it will be back to the base values. Let's look at how to change the priority of Windows tasks in the most convenient way possible.
Agree, experimenting with the settings every time is very inconvenient. There are special programs that can simplify the procedure. For example, Process Explorer and Mz CPU Accelerator. We will not dwell on them in detail; we will only note the essence of their work.
Mz CPU Accelerator allows you to automatically increase the values for the active window program, doing it very efficiently. In addition, it allows you to control the allocation of processor resources, for example, to allocate one or two cores to a program instead of all. In general, the program allows you to increase the speed of applications.
Process Explorer allows you to get detailed information about all processes occurring on your computer and set more advanced settings than the standard Windows tool.
Thus, knowing how to change the priority level in the Task Manager, you can increase the speed of your computer and avoid errors and freezes. If you have tips on how to change this setting in a particular situation when working in Windows, share them with other users by leaving a comment below.
let's talk about Windows process priorities. In most cases, there is no need to “play” with setting priorities, but sometimes a competent system administrator can help the system more correctly distribute processor time between running tasks. There is no single recipe, but by “selection and search” it is quite feasible. Where might this be needed? For example, in the 1C-SQL combination, you can give more processor time to 1C and SQL, as the most resource-critical processes.
In general, you can view and change the priority of a running process through Task Manager
WindowsNT/2000/7 /2008
On Windows 2012 it was “buried” a little deeper
As can be seen from the above examples, only 6 priorities are available to you (as it turns out later, these are priority classes). Enough? Microsoft thinks so. But let's remember the “legendary” phrase of Bill Geist, who said that “640 KB of RAM will be enough for everyone.” But time has shown that this is far from the case. :)
Now let's figure out how it really is.
There are actually 32 priority levels in Windows, from 0 to 31.
They are grouped like this:
When a process is created, it is assigned one of six priority classes:
You can view the process priority, as described above, using Task Manager.
Note: Above normal and Below normal priorities have been introduced since Windows 2000.
Priority of each thread ( base thread priority) consists of the priority of its process and relative priority the stream itself. There are seven relative thread priorities:
The following table shows the process, relative, and base thread priorities.
Thread priority | Process class | Process class | |||||
Idle class | Below normal class | Normal class | Above normal class | High class | Real time class | ||
1 | Idle | Idle | Idle | Idle | Idle | ||
2 | Lowest | ||||||
3 | Below... | ||||||
4 | Idle class | Normal | Lowest | ||||
5 | Above... | Below... | |||||
6 | Below normal class | Highest | Normal | Lowest | |||
7 | Above... | Below... | |||||
8 | Normal class | Highest | Normal | Lowest | |||
9 | Above... | Below... | |||||
10 | Above normal class | Highest | Normal | ||||
11 | Above... | Lowest | |||||
12 | Highest | Below... | |||||
13 | High class | Normal | |||||
14 | Above... | ||||||
15 | Highest | ||||||
15 | Time critical | Time critical | Time critical | Time critical | Time critical | ||
16 | Idle | ||||||
17 | |||||||
18 | |||||||
19 | |||||||
20 | |||||||
21 | |||||||
22 | Lowest | ||||||
23 | Below... | ||||||
24 | Real time class | Normal | |||||
25 | Above... | ||||||
26 | Highest | ||||||
27 | |||||||
28 | |||||||
29 | |||||||
30 | |||||||
31 | Time critical |
Now that we know all this, what can we do about it all? Well, for example, start using.
How else can you run a process with a “non-standard” priority or change it?
Method 1. Launch a task/process and change the priority through Task Manager.
Disadvantages of the method:
Method 2. You can use the START command with the appropriate keys
The available priority options are as follows (I am deliberately omitting the command line options for the command START not related to the described process of working with priorities):
C:\>start /?
Starts a separate window to run a specified program or command.
START ["title"]
LOW Start application in the IDLE priority class.
NORMAL Start application in the NORMAL priority class.
HIGH Start application in the HIGH priority class.
REALTIME Start application in the REALTIME priority class.
ABOVENORMAL Start application in the ABOVENORMAL priority class.
BELOWNORMAL Start application in the BELOWNORMAL priority class.
As you can see, the START command makes it possible to start a process with the same 6 priorities that are available through Task Manager
Disadvantage of the method:
Method 3: Using the wmic.exe utility
As shown above, Task Manager and the START command are quite clunky for the task of assigning priorities. Let's see how to use this more flexibly. We will use the utility wmic.exe.
Command line:
wmic process where name="AppName" CALL setpriority ProcessIDLevel
wmic process where name="calc.exe" CALL setpriority 32768
wmic process where name="calc.exe" CALL setpriority "above normal"
Priorities (predefined):
Retreat. What to do if there are several processes of the same name? The priority of a process can be changed either by the process name or by using the PID (Process ID) of the process.
Here's a short example of running wmic.exe to get the information you need
We use the command:
Note: I will not give an example of executing this command. The list of processes is too large. You can do this yourself, if you wish.
You will get a list of processes running on your local computer. Now run the command:
wmic process list brief | find "cmd.exe"
Result:
I specially launched several copies of cmd.exe to make the illustration more complete.
Now the list of processes is limited only to those processes whose executable module name contains the string “cmd.exe”. Pay attention to the PID of the process(es).
Now let's try to select the processes we are interested in using WMI directly and without resorting to standard command line tools. To do this, simply write:
wmic process where description="cmd.exe" list brief
Result:
Compare your results. Remember the PID of the CMD.EXE process.
Command line to run wmic.exe
wmic process where processid="XXXX" CALL setpriority ProcessIDLevel
Well, now we can change the priority of a specific process (for example, with PID=8476):
wmic process where processid="8476" CALL setpriority 32768
wmic process where processid="8476" CALL setpriority "above normal"
Good day to all. Today, as you understand from the title, we will talk about how speed up your computer and processor using prioritization.
Many people have probably heard that you can use different priorities (background, normal, high, real time, etc.) for different processes, thereby optimizing their performance and allocating more processing power (processor time) to them.
Sometimes this helped significantly speed up the operation of a particular application or the system as a whole, and even (ping) (I will, in principle, outline the reasons for reducing ping depending on processor priorities and power in a separate article).
However, you will agree that, say, a 3D game and a regular notepad are slightly different applications and, obviously, the game needs more processor resources in real time, because being in a 3D application you are unlikely to interact with this very notepad and it You don’t need it for the time being (and the notepad almost doesn’t need any special processor power - that program isn’t there... just like that).
From here, it seems logical that different applications should have different priorities (especially in times of multi-cores), but in practice this is far from reality.
As you already understand, I’m getting at the idea that full-fledged applications should be given higher priority, which will automatically significantly optimize them by injecting more computer resources.
But I think that you will agree that doing this every time (because the priority set in the task manager is forgotten by the system after a restart) manually is a real punishment and generally lazy, and therefore you need to somehow automate this process, i.e. That is, conditionally, speeding up the computer and processor is not entirely manual.
This is what we will talk about in this article.
About two months ago I came across a wonderful program called Mz CPU Accelerator. What it does is that it automatically changes the processor priority of the active window or application to a pre-specified one, which, in general, is what we need, because this is what will speed up the processor and computer.
Moreover, all this is implemented in a really extremely convenient, logical manner and does not require unnecessary movements from the user. Plus, there is support for multiprocessing (multi-core) and the ability to run an application in a separate segment (that is, say, allocate only two cores out of four to a program (this is closer to very targeted optimization)).
Note: How I didn’t come across this miracle before, I don’t know :)
Namely:
If you wish, you can also check Check for updates on startup (so that you can immediately check whether program updates have come out), and also choose how the program will be displayed in the tray according to your taste: Show Mz CPU Accelerator Icon (the icon of the program itself will be in the tray) or Shows CPU Usage (shows how busy it is) (the color of the numbers is selected from the drop-down list).
That's all, all that remains is to press the Activate button and enjoy how the computer, or more precisely, the active window or application, has accelerated.
What else is worth knowing and understanding on this topic:
Now let's move on to the afterword.
Here's the thing. In general, I really liked the program, because it is really effective and allows you to speed up your computer, Windows, and, relatively speaking, the processor.
By the way, in theory, the increase will be felt especially strongly by owners of multi-core processors, as well as users of the FireFox browser (it is processor-dependent and, when receiving Realtime priority, it begins to fly noticeably faster (especially in a compartment)) and everyone who is somehow connected with processor-dependent full-fledged applications (this I'm talking about all sorts of renderings in photos, videos and 3D editors).
If you have any questions, then, as always, ask in the comments to the article - I will be glad to help.
PS: Reviews about personal feelings in terms of productivity gains are no less interesting than questions;)