Remove qoslock

Creating a reader/writer in a listener for a built-in topic (as ddsperf
does) recursively ends up in reader/writer matching, recursively
read-locking qoslock.  As nobody ever takes a write-lock, it is a
non-issue provided the rwlock really is an rwlock.  On Solaris 2.6 those
don't exist, and mapping it onto a mutex deadlocks.

This commit removes the thing in its entirety, the fact that it is
currently only ever locked for reading is hint that perhaps it is not
that valuable a thing.  The way it was used in the code would in any
case not have helped with re-matching on QoS changes (save for
duplicating all the matching code), and it is doubtful that serializing
the matching in that case would be necessary in the first place.

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-07-05 22:28:41 +02:00 committed by eboasson
parent 96e09d2d4e
commit 47920df65c
3 changed files with 0 additions and 12 deletions

View file

@ -195,10 +195,6 @@ struct q_globals {
struct addrset *as_disc;
struct addrset *as_disc_group;
/* qoslock serializes QoS changes, probably not strictly necessary,
but a lot more straightforward that way */
ddsrt_rwlock_t qoslock;
ddsrt_mutex_t lock;
/* Receive thread. (We can only has one for now, cos of the signal

View file

@ -1294,7 +1294,6 @@ void rebuild_or_clear_writer_addrsets(int rebuild)
struct addrset *empty = rebuild ? NULL : new_addrset();
DDS_LOG(DDS_LC_DISCOVERY, "rebuild_or_delete_writer_addrsets(%d)\n", rebuild);
ephash_enum_writer_init (&est);
ddsrt_rwlock_read (&gv.qoslock);
while ((wr = ephash_enum_writer_next (&est)) != NULL)
{
ddsrt_mutex_lock (&wr->e.lock);
@ -1318,7 +1317,6 @@ void rebuild_or_clear_writer_addrsets(int rebuild)
}
ddsrt_mutex_unlock (&wr->e.lock);
}
ddsrt_rwlock_unlock (&gv.qoslock);
ephash_enum_writer_fini (&est);
unref_addrset(empty);
DDS_LOG(DDS_LC_DISCOVERY, "rebuild_or_delete_writer_addrsets(%d) done\n", rebuild);
@ -2334,10 +2332,8 @@ static void generic_do_match (struct entity_common *e, nn_mtime_t tnow)
enumerating), but we may visit a single proxy reader multiple
times. */
ephash_enum_init (&est, mkind);
ddsrt_rwlock_read (&gv.qoslock);
while ((em = ephash_enum_next (&est)) != NULL)
generic_do_match_connect(e, em, tnow);
ddsrt_rwlock_unlock (&gv.qoslock);
ephash_enum_fini (&est);
}
else
@ -2386,10 +2382,8 @@ static void generic_do_local_match (struct entity_common *e, nn_mtime_t tnow)
enumerating), but we may visit a single proxy reader multiple
times. */
ephash_enum_init (&est, mkind);
ddsrt_rwlock_read (&gv.qoslock);
while ((em = ephash_enum_next (&est)) != NULL)
generic_do_local_match_connect(e, em, tnow);
ddsrt_rwlock_unlock (&gv.qoslock);
ephash_enum_fini (&est);
}

View file

@ -1253,7 +1253,6 @@ int rtps_init (void)
gv.gcreq_queue = gcreq_queue_new ();
ddsrt_atomic_st32 (&gv.rtps_keepgoing, 1);
ddsrt_rwlock_init (&gv.qoslock);
if (config.xpack_send_async)
{
@ -1645,7 +1644,6 @@ void rtps_fini (void)
nn_plist_fini (&gv.default_plist_pp);
ddsrt_mutex_destroy (&gv.lock);
ddsrt_rwlock_destroy (&gv.qoslock);
while (gv.recvips)
{