Page 1 of 1

Re: [Nagios-devel] Multithreaded Macro Support wrapper proposal

Posted: Tue Aug 25, 2009 7:36 am
by Guest
Steven D. Morrey wrote:
> The macro functions take almost no time. The problem is one of trying
> to use shared mutable global memory. It's not a problem unless more
> than 1 thread is trying to access the macros at once. Under that
> scenario thread A may delete a macro at the same time thread B is
> trying to read it. This causes segfaulting I was seeing earlier.
>

Well, you can update macros atomically without ever needing locking.
That would be the best solution by far for the global macros. Object
specific macros shouldn't be global in the first place, and should
really only be looked up on-demand, with the strings being returned
from their source (such as $HOSTNAME$ being taken from the immutable
host_object->host_name variable).

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]