[Asterisk-Users] Thoughts on Adding Locking to db.c?

George Pajari George.Pajari at netVOICE.ca
Thu Sep 16 02:13:37 MST 2004


We're working on an application in which it appears it would be far more
efficient to share data between Asterisk and external applications by
simultaneously accessing and updating astdb.

While the current asterisk/db.c code uses ast_mutex_lock and unlock pairs to
protect the integrity of astdb from multiple Asterisk threads, this of
course does nothing to protect astdb from external (i.e. non-Asterisk) apps.

Does the list have any thoughts about the advisability (or inadvisability)
of modifying db.c to use flock instead of ast_mutex_lock?

As an aside I am aware that one could use AGI or an external SQL database
for such data sharing; I would just prefer to avoid such overhead or
complications in this situation.

One could even envision making this a configuration option (i.e. "astdb =
shared").

Thoughts and flames please.

George Pajari
netVOICE communications
www.netvoice.ca
www.ip-centrex.ca




More information about the asterisk-users mailing list