On Tue Feb 11 09:16:46 2025 +0000, Rémi Bernon wrote:
I don't think we should preventively guard against issues like that at the cost of making the code so much difficult to follow. If wineserver / kernel state usages are exclusive, it should IMO be explicit in the code (not through comments). If we still need and can make things lazier later then we can consider it, but maybe it's not even going to be needed. If it really is, it should probably be hidden in the inproc sync logic (like only create the fd lazily).
But it's not preemptive, there are multiple applications that open huge quantities of handles that they never use.
Moving the lazy initialization to the inproc_sync object itself would alleviate it partially, but we'd still be allocating tons of memory in wineserver that we don't need. Lazily allocating seems like a worthwhile tradeoff, when we can explain the arrangement in comments.