Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

> NtGdiCloseProcess has a system-wide global lock which is used quite often

"Holds" rather than "has", and importantly that system-wide lock must be held by things like SendMessageW (which sends a message and waits for its processing before returning) which is pretty critical for UI updates.

This is compounded by parallelised build processes as not only do they spawn lots of processes leading to lots of process destruction: it both fucks up the UI and completely serialises process destruction so your nice 24 process flights for faster processing end up taking multiple seconds to all shut down, and the more cores (and thus processes) you have the worse it is, and the worse your stutters.



> "Holds" rather than "has", and importantly that system-wide lock must be held by things like SendMessageW (which sends a message and waits for its processing before returning) which is pretty critical for UI updates.

Do you happen to know anything about it? I'm scratching my head how it's possible that process termination serializes with GUI... Maybe it hogs some lock on process descriptors which SendMessage also needs to grab for a moment to find the target process? I hope you didn't mean to say that every SendMessage call is completely serialized with each other.


> Do you happen to know anything about it? I'm scratching my head how it's possible that process termination serializes with GUI…

Not anything more than what's in the essay. But possibly some (pair of) utility function calls were added for e.g. a cleanup or notification to the OS between W7 and W10 which was not noticed at the time.

> I hope you didn't mean to say that every SendMessage call is completely serialized with each other.

It's my understanding that at least a subset of SendMessage is serialised in the kernel yes, and from the essay:

> functions like SendMessageW, apparently waiting on a kernel critical region[…], deep in the call stack in win32kbase.sys!EnterCrit (not shown)

[0] https://msdn.microsoft.com/en-us/library/windows/desktop/dd7...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: