Multithreaded Macro Support wrapper proposal

Andreas Ericsson ae at op5.se
Tue Aug 25 10:36:12 CEST 2009


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




More information about the Developers mailing list