Introducing a distributed lock for synchronizing algorithm context map and moving service references to ServiceReferenceHolder