On 2019-12-27 12:33, Ronald Klop wrote:
Wow, this looks like a winner.
Ronald.
Is this a spin-off from epoch methodology?
It is possible to use epoch as a part of read mostly locking too.
The basic idea here is to have a variable/refcount which when set,
fallback to a regular mutex during read-locking. This is all
synchronized under epoch.
Pseudo code:
read_lock() {
epoch_enter();
do_lock = writers != 0;
if (do_lock)
mtx_lock();
}
read_unlock() {
if (do_lock)
mtx_unlock();
epoch_exit();
}
write_lock() {
writers++;
epoch_wait();
mtx_lock();
}
write_unlock() {
mtx_unlock();
writers--;
epoch_wait();
}
--HPS
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"