- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Hello all;
I have loolked at the Distributed Reader-Writer Mutex by Dmitry Vyukov, look at
http://www.1024cores.net/home/lock-free-algorithms/reader-writer-problem/distributed-reader-writer-mutex
and i have looked at it and i think there is a problem with this method, cause look
at the write lock function:
int distr_rw_mutex_wrlock (distr_rw_mutex_t* mtx)
{
int i;
for (i = 0; i != mtx->proc_count; i += 1)
pthread_rwlock_wrlock(&mtx->cell.mtx);
return 0;
}
What is wrong with it ? suppose two or more writers wants to lock this distributed rwlock
there is a possibility of a deadlock.
So i think you have to use a critical section around the for loop to be able to lock
all the rwlocks at the same time to avoid the deadlock problem..
Am i correct or not ?
Thank you,
Amine Moulay Ramdane.
Lien copié
4 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I wrote:
> So i think you have to use a critical section around the for loop to
be able
> to lock
> all the rwlocks at the same time to avoid the deadlock problem..
> to lock
> all the rwlocks at the same time to avoid the deadlock problem..
I mean you have to use a critical section around the for loop to be
able
to lock all the rwlocks atomicly to avoid the deadlock problem..
to lock all the rwlocks atomicly to avoid the deadlock problem..
Thank you,
Amine Moulay Ramdane.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Sorry for my english: i mean atomically.
Thank you,
Amine Moulay Ramdne.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Patricia Shanahan wrote:
> The text explanation on the referenced web page says 'No
additional
> synchronization between writers is required, writers acquire the mutexes
> in the same order (from 0 to P-1), so ownership over mutex 0 basically
> determines who is the "current" writer (all other potential writers are
> parked on mutex 0).'
> synchronization between writers is required, writers acquire the mutexes
> in the same order (from 0 to P-1), so ownership over mutex 0 basically
> determines who is the "current" writer (all other potential writers are
> parked on mutex 0).'
You are absolutly right.
Thank you,
Amine Moulay Ramdane.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Patricia Shanahan wrote:
> The text explanation on the referenced web page says 'No
additional
> synchronization between writers is required, writers acquire the mutexes
> in the same order (from 0 to P-1), so ownership over mutex 0 basically
> determines who is the "current" writer (all other potential writers are
> parked on mutex 0).'
> synchronization between writers is required, writers acquire the mutexes
> in the same order (from 0 to P-1), so ownership over mutex 0 basically
> determines who is the "current" writer (all other potential writers are
> parked on mutex 0).'
You are absolutly right.
Thank you,
Amine Moulay Ramdane.

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable