names: turn registry lock into rwsem
authorDavid Herrmann <dh.herrmann@gmail.com>
Fri, 11 Apr 2014 01:33:45 +0000 (03:33 +0200)
committerDavid Herrmann <dh.herrmann@gmail.com>
Fri, 11 Apr 2014 20:53:02 +0000 (22:53 +0200)
commitc9995d6f23a593556939116c833cf13b99272a34
tree0bcf01dfe66b7e3b407049065abbcfa64093ecdd
parent7f7f9be7936d805c63c2f189bd0dc2780812e394
names: turn registry lock into rwsem

Imagine a racing name-acquire and msg-send. The msg-send might lookup the
destination name, which might be an activator. But before it can queue the
message, the racing name-acquire installs and implementor and moves all
pending messages from the activator to the implementor. If the original
msg-send afterwards continues, it will still queue the in-flight message
on the activator instead of the implementor.

After 1 day of discussion, we decided on turning the registry into a
read-write lock. This way, any msg-send will be locked against
name-changes. A name-change requires a writer lock, but any in-flight
message will hold a regsitry read-lock from the name-lookup until it
queued the message.

This patch only converts the lock, following patches will close the races.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
connection.c
names.c
names.h