synchronization for scala  interpreter
preinitialization for groovy runner
extracted SingleThreadBackgroundRunner