3

Closed

Multithreading support

description

There is no support for multithreading work now as I see. I think it would be good desing choose to redevelop from static objects to non-static objects, like:
MapperInstance mapper = Mapper.CreateMapper();
mapper.CreateMap<TA, TB>();
.....
var result = mapper.Map<TA, TB>(source);
Closed Sep 2, 2011 at 10:47 PM by jbogard
All issues moved to GitHub https://github.com/AutoMapper/AutoMapper/issues

comments

jbogard wrote Oct 30, 2009 at 1:05 AM

Mapper.CreateMap is not threadsafe, nor will it ever be. However, Mapper.Map is thread-safe. The Mapper static class is just a thin wrapper on top of the MappingEngine and Configuration objects.

raramer wrote Jan 4, 2010 at 4:39 PM

You mention that Mapper.Map is thread-safe, but my experience with Mapper.DynamicMap is that it is not thread-safe because of the call to Configuration.CreateTypeMap. It seems like DynamicMap should be consistent with Map.

jbogard wrote Jan 7, 2010 at 3:12 PM

Perhaps, but DynamicMap isn't Map. It's CreateMap, then Map. I could lock the configuration, however for that operation.