def init(): """ Gloabl Initialization routine for task """ """ general initialization """ socket.setdefaulttimeout(config.timeout) """ Create SharedState and give it runf """ state = SharedState(task_name) state.counter = 0 state.runf = runf """ Necessary step, initialize the task queue """ for _ in range(1000): state.queue.put(None) return state