# Multithreading with map

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmultithreading-with-map%2F29936%3E%5C
**Category:** 🤗Datasets\
**Created:** [January 18, 2023, 8:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmultithreading-with-map%2F29936 "2023-01-18T08:53:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muennighoff](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/muennighoff/32/11884_2.png) [@Muennighoff](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FMuennighoff)%5C
**Post date:** [January 18, 2023, 8:53am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmultithreading-with-map%2F29936%2F1 "2023-01-18T08:53:21Z")

</div>

Is it possible to use multithreading with `dataset.map(...)`? I’m currently using multiprocessing via `num_proc`, but it’s too slow as my processing function makes Internet requests.  
Using more threads via multithreading could speed it up, no?  
cc @lhoestq 🤗

---

<div class="post-metadata">

**Author:** ![lhoestq](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lhoestq/32/64813_2.png) [@lhoestq](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flhoestq)%5C
**Post date:** [January 23, 2023, 1:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fmultithreading-with-map%2F29936%2F2 "2023-01-23T13:17:35Z")

</div>

Hi ! I think you’d need to implement the multithreading in the function you pass to `map`
