When something’s not working right on your Mac, one of the most common and effective solutions is to restart it. What happens next is that the Mac shuts down and immediately restarts, going through the full boot process. That’s not quite the same as shutting down, leaving your Mac a minute or two, then starting up, what’s often known as a cold boot. But in many cases, neither of those is necessary, and it’s quicker and less disruptive to log out and log back in again.
Take a look in Activity Monitor to understand how this might work. View all processes in the CPU tab and sort them by the User column. You’ll see the majority of users are you, the user who’s currently logged in. Those at the bottom of the list are running as root, and there are some with custom users such as _spotlight in the middle. When you log out but don’t restart your Mac, many of those processes running as the current user should be shut down, and only started up again when you log back in.
This can sometimes fix problems with WindowServer, although it isn’t normally shut down when you log out, neither is the troublemaker
cfprefsd. Contrary to what you might expect, some user processes continue running uninterrupted even after you’ve logged out. However, in the recent past macOS itself has used user logout as a way to restart WindowServer without rebooting. When you suspect WindowServer problems, logging out and back in again is usually a first attempt, although in more recent versions of macOS, that may not help, and a complete restart may be the only way to address this.
cfprefsd is a particular nuisance here, as there are normally both root and user copies running to handle all those preferences. You wouldn’t expect the root copy to be affected by logging out, but at least the user copy could have the decency to do so. This means that, if you’re trying to slip a manual change to a preference file past
cfprefsd, a full restart is likely to be required.
So how can you tell which processes could be refreshed by this manoeuvre? To find out, sort the list of processes in Activity Monitor by their Process Identifier or PID.
At the top, with PID 0, you’ll see
kernel_task, followed by
launchd with a PID of 1. As these PIDs are assigned in simple numerical order, they reveal the order of process startup. Find WindowServer in the list, and it’ll generally have a PID of around 152. Not too far below it you should see the first user process,
loginwindow, at around 166; that’s also the first process to be given its own icon at the start of the line. Processes with lower PIDs were all started before login, and those with higher PIDs were started afterwards.
Some of those user processes, and some of those with PIDs greater than
loginwindow, should be shut down when you log out, then be started up again, as needed, when you log back in again. But if try that and check PIDs again, and glance at the CPU Time column, it’s apparent that many user and other late-loading processes retain low PIDs and long CPU times. To refresh those a restart will be needed, another example where saving effort in macOS doesn’t help you maintain it.
Normally, this manoeuvre should only take a few seconds to complete. Because your Mac isn’t starting up from scratch, its Bluetooth remains working throughout, so there’s no frustrating delay before you can type your password in. With a bit of luck your Mac should then be back in fine fettle again, ready for you to resume work with the minimum of disruption.
What this doesn’t do, of course, is flush the caches and clean up any accumulated crud in your user account. For that, starting up in Safe mode remains the only solution. Remember that has changed on M1 Macs, which have to be shut down and started up in Recovery before the option of Safe mode is available. That’s not as convenient as holding the Shift key down on an Intel Mac, but neither do you have to remember all those arcane startup key combinations.