1) sync processes' access to shared objects. 2) refactor VocabEncoder.