Jerry Feldman wrote:
On Sun, 09 Jul 2006 16:27:30 +0100 peter burden <peter.burden@gmail.com> wrote:
Hello, Are there any problems with the pthread_rwlock routines ? I see some prototype warning messages on compilation but the programme seems to link OK and, as far as I can tell with a multi-threaded application, seems to work OK.
Any recommendations for checking the various possible patterns of mutual interaction between threads in an MT application ??
Using gcc 4.1.1 and libc-2.3.5
I am not familiar with "pthread_rwlock". The locks are set using pthread_mutex_lock and released using pthread_mutex_unlock.
I'm also using mutex_lock and cond_wait etc., elsewhere in the programme for various other types of synchronisation.
You should be using NPTL threads. Are you including #include <pthread.h> Additionally, threads have different behavior on single vs. multi-processors. And remember, that some Intel chips also have a feature called hyper-threading which effectively simulates a second CPU. Please post the warning messages. You should not have any prototype warnings unless you are passing the wrong type of parameters.
Yes, using NPTL and pthread.h is included. Here's the uname -a output Linux linux 2.6.13-15-default #1 Tue Sep 13 14:56:15 UTC 2005 i686 athlon i386 GNU/Linux Here's the warnings :- gcc -O -c -g -I/home/peter/spider/include -DDEBUG=7 -pthread -DLINUX -funsigned-char -Wall -Wextra -fstack-protector-all -c -o cachegen.o /home/peter/spider/source/cachegen.c /home/peter/spider/source/cachegen.c: In function ‘getfromcache’: /home/peter/spider/source/cachegen.c:157: warning: implicit declaration of function ‘pthread_rwlock_rdlock’ /home/peter/spider/source/cachegen.c:171: warning: implicit declaration of function ‘pthread_rwlock_unlock’ /home/peter/spider/source/cachegen.c:175: warning: implicit declaration of function ‘pthread_rwlock_wrlock’