Should be multi threaded