Skip to content

Keep Wineserver Alive Once Wine is Called - #2514

Merged
stakira merged 3 commits into
openutau:masterfrom
atouu:keep-wineserver-alive
Oct 27, 2026
Merged

stakira merged 3 commits into
openutau:masterfrom
atouu:keep-wineserver-alive

Conversation

@atouu

@atouu atouu commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Speed up wine by keeping wineserver running in the background.

The background process has a timeout of 2 minutes and only runs when needed.

Result with moresampler (multithread-synthesis off, multithreading handled by OpenUtau):

Before After
before-keep-wineserver-alive after-keep-wineserver-alive gif

@atouu
atouu requested a review from a team October 9, 2026 17:21
@stakira

stakira commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Could you check if the below is true?

"The entire daemon logic could be replaced by a single call to wineserver --persistent (or wineserver -k + background wineserver) which is the canonical way to keep wineserver alive, rather than spawning a cmd.exe /c timeout process. That eliminates the :: hack, the 120-second arbitrary timeout, and most of the lifecycle management. Alternatively, if the cmd.exe approach is kept, the lock/sleep/Exited-handler dance can be simplified to a Lazy<Process> or Interlocked.CompareExchange pattern that avoids sleeping under a lock."

@atouu

atouu commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

I chose the cmd.exe approach to not rely on another binary which is wineserver since I'm not sure if wineserver path is guaranteed to be placed next to wine binary and I think adding another preference for it is cumbersome. :: is just a comment in batch, just to display the purpose in process name. Thread.Sleep under a lock is intentional since I noticed that continuing right away after cmd.exe can cause issues, we need to wait for wineserver first. I think Lazy and Interlock is unnecessary.

Comment thread OpenUtau.Core/Util/WineRunner.cs Resolved
Co-authored-by: Celeb-17 <celeb17.kurisutina@gmail.com>
@stakira
stakira merged commit b7c35b9 into openutau:master Oct 27, 2026
3 checks passed
emeraldsingers added a commit to emeraldsingers/UtauV that referenced this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants