Prepare one minibatch of data in one thread and train it in another thread

i create a model with pytorch, for trainng i need to read and prepare a batch of data in one thread and train this batch of data in onother thread . is there any method to do that with pytorch?