[stringtemplate-interest] thread safety
John D. Mitchell
jdmitchell at gmail.com
Fri Nov 13 13:02:22 PST 2009
On Nov 13, 2009, at 12:08 , Terence Parr wrote:
> On Nov 13, 2009, at 11:55 AM, John D. Mitchell wrote:
>>> Oh right. cache invalidation / reload would need to be atomic. I'll
>>> have to lock for that.
>>
>> Should be cheap as you're just swapping a pointer to the newly loaded
>> & compiled object, right?
>
> Should be something like "load in background then swap with single
> ptr". that should be thread safe, right? ptr assign is atomic.
Remember to mark it as "volatile".
Have fun,
John
More information about the stringtemplate-interest
mailing list