[bind10-dev] Multicore Auth
Shane Kerr
shane at isc.org
Fri Jul 15 14:45:46 UTC 2011
Michal,
On Wed, 2011-07-13 at 14:09 +0200, Michal 'vorner' Vaner wrote:
> Hello
>
> On Wed, Jul 13, 2011 at 11:33:03AM +0100, Stephen Morris wrote:
> > A variant of this would be to use two copies of the data:
> >
> > Programs map to one copy and answer queries from it. There is no
> > locking as all access is read-only.
>
> There's still some kind of synchronization to do the switch or something. Maybe
> it's not exactly locking, but something can't be avoided I guess. But yes,
> having to do it only at the switch looks nice.
If updates to the data source are rare, then we can use normal file
descriptor based notification, such writing a byte to a pipe or socket.
Since our processes are waiting on socket events anyway, this shouldn't
add any additional complication.
Each reader needs to notify the writer that they have switched to the
new copy. The writer will have to wait until all of the readers have
finished this operation before it can clean up the old copy. This will
require locking, but we can stagger notifications slightly if we need to
avoid having all of the readers trying to get the new copy at the same
time.
This hints at something else, which is that we can control when updates
happen. We don't necessarily need to point the readers to a new copy on
every update. We can do this using some sort of heuristic, for example
after (int)X updates or (float)Y seconds, whichever happens first.
--
Shane
More information about the bind10-dev
mailing list