http://bugs.winehq.org/show_bug.cgi?id=29168
--- Comment #151 from Xolotl Loki xoloki@gmail.com 2012-03-10 17:37:39 CST --- Created attachment 39300 --> http://bugs.winehq.org/attachment.cgi?id=39300 KUSER_SHARED_DATA updates using a dedicated thread per swtor process
Here's my current patch. It updates KUSER_SHARED_DATA with a dedicated thread per swtor process. It works better for me than Carsten's patch, but it still suffers from freezing, though the frequency varies: a starter character on Tython can play for hours, but a Sith Assassin on Hoth starts freezing almost immediately.
The thread's priority can be controller via the env variable
WINE_USER_DATA_THREAD_PRIORITY
Default is 20.
The sleep time in nanosecond can be controlled via
WINE_USER_DATA_THREAD_NSLEEP
Default is 15625000 (15.625 ms).
I've included my NtTimer code, commented out. I'm not sure why it didn't work, since apparently the updates really don't need to be very fast.
The update thread is only spawned for the swtor processes. To determine this, I had to look in the CommandLine process variable. I had to manually convert the UNICODE_STRING to ANSI; when I tried to use RtlUnicodeToMultiByteN it segfaulted.
I think this is a more general fix than Carsten's, since there will be no overlapping writes (single writer thread per process). But it still doesn't solve the freezing issue, which I'm no longer sure is related. I've noticed that during the freezing, the RemoteRenderer process stops consuming CPU, so it seems like something is deadlocked in the renderer.
Can people please try my patch and report your results?