Get kernel and dataset in worker instead of passing data from main thread.