UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2010-06-15 06:28 AM

sid.bond.86
Member
Registered: 2010-06-15
Posts: 3

Re: NSS - Caching

Hi,
I am trying to deveop a new NSS service.

In NSS we have functions in two ways getxxbyy and getxxbyy_r wherein *_r are rentrant functions.

In my service I am calling a remote api to fetch the name data from it. Since its a remote api, i wanted to cache the data between the calls, so that i can reduce the n/w communication costs.

In reentrant version of the function we have a buffer which is passed by the caller of the function, which we can use to cache the results.

Is there any way to extend the caching for the non rentrant version of the function.

Offline

#2 2010-06-15 08:36 AM

sid.bond.86
Member
Registered: 2010-06-15
Posts: 3

Re: NSS - Caching

bump

Offline

#3 2010-06-18 06:00 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: NSS - Caching

Just use static variables to store the data...  That's what the non-reentrant versions
of getXbyY() all do, and is exactly why they are non-reentrant...

Offline

#4 2010-06-18 07:07 PM

sid.bond.86
Member
Registered: 2010-06-15
Posts: 3

Re: NSS - Caching

Thanks a lot.. :).. i think i shud be able to do this now :)

Offline

Board footer

Powered by FluxBB