Re: Question regarding life time of backend threads in PDNS
Peter van Dijk <[email protected]>
| Newsgroups | gmane.network.dns.powerdns.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello Seema, On Nov 7, 2013, at 6:19 , Seema Datar wrote: > We have a use case where we use PDNS with 8 backend threads. We needed to save thread specific data in an mmap. However, I came across the following in PDNS documentation - > > PowerDNS may instantiate multiple instances of your backend, or destroy existing copies and instantiate new ones. Backend code should therefore be thread-safe with respect to its static data. Additionally, it is wise if instantiation is a fast operation, with the possible exception of the first construction. > > The questions I had are - > > • What is the lifetime of a backend thread? Sometimes, only one query. > • How often does a thread get destroyed and a new thread get created? Some threads will live for a long time. Some other threads will come and go quickly. > • Is there any interface available to do a cleanup before the thread ends? Yes - the class destructor. Look at GeoBackend::~GeoBackend() or LUABackend::~LUABackend() for an example. By the way, please keep these posts confined to the pdns-dev list. Kind regards, -- Peter van Dijk Netherlabs Computer Consulting BV - http://www.netherlabs.nl/ _______________________________________________ Pdns-dev mailing list [email protected] http://mailman.powerdns.com/mailman/listinfo/pdns-dev
signature.asc
(application/pgp-signature, 841 B)
-----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIcBAEBAgAGBQJSe6aUAAoJENz1E/p+7Rnz6lMP/iq/NaQphk/O2Vz5PTz1fSdc q4f3oEtJSzU/WWhaEUIXXHlhO5Sr2FZOWd+fcYco+tYEyI56QgfKT5ndOYOiXQ6/ DMPVFEb+riDKyNh38BfflaJ2rZEWs7VpqkzIaTNkI68mJY7C/Q3r8nmLo9Tqhk7n EEPhIUZeEVxr+U9GWzWFVEFyJl2cLNws4TupIiVj+R37bORHQWK1pUpWraDQNsz/ EvE4fckAbhOdxufHeFurfHCSa+ajQHCtOC7jWcFRf0NEcYoW+FSYM8/T5wxFJsiS sXX5hOUKMSIFx+urelLo+wrAZmmGzE8ZE+98c+KMX5Lk4sCCWfQkXueRuzPbO8zl JyCoYhubl/JdTlIGDM10hkD/+x0hlQlGTdz8ZWlM8ll0qj+GQPpiba4LN+19bBSe PYkqYWD0TnJ183uSJs6II/CfIUkKdvtLa0IfaXo+g+lD4iAIE4TzV0SeQc2lIniY ru4pHnOeoMN2FjZCUYhSeVw7+BP4kOoW9eUB4jw0HjgJDMTUyTpHOAIfhSGpRG36 tPbI+q90jClikP+24Lw46oWHTlNPUdroKRH6qRB0EIl0G5s1lbmZPbRFDAwXzhL1 sYWKYAElphtvtr56vcj/u3G8v69loRiG0I0ddWtNzMAGkIcLljNQjr1P8fsXPa9U AFgMIA/3suv0bOsYiQVo =s6X0 -----END PGP SIGNATURE-----