pthread_mutex in a winelib dll called from a win32 application

Shachar Shemesh wine-devel at shemesh.biz
Wed Jul 21 05:08:57 CDT 2004


Hi all,

Are there any restrictions in synchronizing wine generated threads 
(generated through the win32 api) using the pthreads library native calls?

I have an app that is experiencing extremely slow performance (operation 
takes 17 seconds on native windows, over 3 minutes on Wine). One idea 
for solving this problem was to switch some of the synchronization 
operations over to native pthreads (it's using wine as part of a 
migration to Linux process).

The problem is that when I try to call pthread_mutex_init, 
pthread_mutex_lock and friends, I get quite a few deadlocks, and even 
when not deadlocking, it still takes over 42 seconds. When doing the 
same without the mutexes (I'm locking write access to a pipe - I'm not 
sure it's even necessary, and it is working without the lock too), wine 
performs at 21-26 seconds. I don't think that obtaining a posix mutex 
should have such harsh effect on performance.

Is it at all ok to try and synchronize threads created with 
"CreateThread" using posix constructs?

             Shachar

-- 
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/




More information about the wine-devel mailing list