On Wed Jun 28 14:25:09 2023 +0000, Rémi Bernon wrote:
Yes, isn't that what you meant by "separate mappings per thread"? Or maybe you just meant avoid mapping the desktop shared memory multiple times on the client side?
1. [user-handles] is tracking per-*session* state (`gSharedInfo`). It appears to me that a *process* is associated with at most one session at any time. Also, each *process* has only one mapping backed by the session shared memory.
2. This MR is tracking per-*desktop* state (`desktop_shm_t`). It appears to me that a *thread* is associated with at most one desktop at any time. Also, each *thread* has only one mapping backed by the desktop shared memory. - Transitively, a process can have multiple mappings backed by some desktop shared memory, since a process can have multiple threads. - If two or more threads have the same desktop, then each of those threads will have a *different* mapping backed by the *same* desktop shared memory. I believe *this* part is what is believed to be wasteful.
[user-handles]: https://gitlab.winehq.org/jacek/wine/-/tree/user-handles