I'm researching how sling framework work behind the sence. But my knowledge on multi thread programming is very limited to understand what they are doing, here's my issue:
This is the class i'm working on AdapterManagerImpl.java, on function registerAdapterFactory (line 247) they defined a synchronized code block at line 281 it is:
synchronized ( adfMap ) {
adfMap.put(reference, factoryDesc);
}
Any one can explain me why adfMap
is a shared resource and marked as synchronized ? How does it afftect to performance ?