This is the mail archive of the
mailing list for the pthreas-win32 project.
Re: pthread_init_mutex problem
- From: "Phil Frisbie, Jr." <phil at hawksoft dot com>
- To: ssundaragopalan at hss dot hns dot com
- Cc: pthreads-win32 at sources dot redhat dot com
- Date: Sat, 04 May 2002 11:30:03 -0700
- Subject: Re: pthread_init_mutex problem
- Organization: Hawk Software
- References: <65256BAF.00273A7F.firstname.lastname@example.org>
> hi all,
> i am new to this mailing list. i am using pthreads for windows and
> have the following problems.
> The function pthread_mutex_init is taking up CPU to a large extent....In
> our program we have a lock for each data structure and this data struture
> is initialized every time a new messsage is received. So under Load
> conditions the CPU utilization is reaching 100%.
> Can anyone suggest some ways to bring down this.
You can reuse your data structure. I am already doing this in my HawkNL
network library for the internal socket structures. The socket structure
includes 2 mutexes. When I 'free' a socket, the structure in marked as
free, and the mutexes are reused when I need a new socket.
Phil Frisbie, Jr.