Hi, Which object doesn't exist?
You can just protect access to your cache container with mutexes. I believe the Model1Feature does something similar. https://github.com/moses-smt/mosesdecoder/blob/master/moses/FF/Model1Feature.cpp There might be more beautiful solutions, though. Independent thread-specific caches would be useful. Cheers, Matthias On Sun, 2016-02-21 at 20:23 -0800, Jasneet Sabharwal wrote: > Is it possible to cache some data when decoding a source sentence? I > was trying to use boost's thread_specific_ptr to cache a map which I > want to update in my evaluation function but when I try to access the > map > (https://github.com/KonceptGeek/mosesdecoder/blob/RELEASE-3.0-CombinedFeature-Caching/moses/FF/CoarseBiLM.cpp#L145-L154) > I get segmentation fault as the object doesn't exist. > > Is there any other way to do some caching? -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. _______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
