Are you concerned about the potential performance issue or about deadlocking the process?
I would assume PIL takes care of the latter problem.
Do you have any particular idea how to handle the first case?
You could try to use the current worker id in your __getitem__ method to e.g. reset the random seed with the current index.

class MyDataset(Dataset):
    def __init__(self):
        self.data = torch.randn(10, 1)
        
    def __getitem__(self, index):
        print(torch.utils.data.get_worker_info().id)
        x = self.data[index]
        return x
    
    def __len__(self):
        return len(self.data)


dataset = MyDataset()
loader = DataLoader(
    dataset,
    num_workers=2
)

next(iter(loader))