From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4531 invoked by alias); 4 May 2002 17:42:55 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 4491 invoked from network); 4 May 2002 17:42:52 -0000 Received: from unknown (HELO mail.sneakemail.com) (207.106.87.13) by sources.redhat.com with SMTP; 4 May 2002 17:42:52 -0000 Received: (qmail 8678 invoked from network); 4 May 2002 17:42:45 -0000 Received: from localhost (HELO monkey) (127.0.0.1) by localhost with SMTP; 4 May 2002 17:42:45 -0000 Message-ID: <308310176.1020534165595.JavaMail.root@monkey> Date: Sat, 04 May 2002 10:42:00 -0000 From: 5qduh001@sneakemail.com To: ssundaragopalan@hss.hns.com, pthreads-win32@sources.redhat.com Subject: Re: pthread_init_mutex problem Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-SW-Source: 2002/txt/msg00058.txt.bz2 I'd be interested in measurements comparing calling pthread_mutex_init() vs. using PTHREAD_MUTEX_INITIALIZER. I.e the code from the earlier e-mail: pthread_mutex_t mutex; assert(pthread_mutex_init(&mutex, NULL) == 0); vs. pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; I haven't looked at the win32 pthread source to see what happens in either, but I can only imagine that the latter would be more efficient if the implementation in win32 pthreads is anything like what most other implementations do (a linux implementation in this case), basically: pthread_mutex_t mutex = {0, 0, 0, PTHREAD_MUTEX_FAST_NP, {0, 0}}; As I understand it, using PTHREAD_MUTEX_INITIALIZER should also allow you to avoid the call to pthread_mutex_destroy() thus another saving. If the PTHREAD_MUTEX_INITIALIZER is faster as I suspect, please let us know and by roughly how much :). Good luck, Dave ----------------------------------------------------- Protect yourself from spam, use http://sneakemail.com