Multithreaded Macro Support wrapper proposal

Steven D. Morrey smorrey at ldschurch.org
Tue Aug 25 17:44:02 CEST 2009


Thats pretty much what I'm doing, glad to know I'm on the right track!
_______________________________________
From: Andreas Ericsson [ae at op5.se]
Sent: Tuesday, August 25, 2009 2:36 AM
To: Nagios Developers List
Subject: Re: [Nagios-devel] Multithreaded Macro Support wrapper proposal

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                   andreas.ericsson at op5.se
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.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


 NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july




More information about the Developers mailing list