# Using Threads with I/O to processing many files in parallel

**URL:** <https://discourse.julialang.org/t/using-threads-with-i-o-to-processing-many-files-in-parallel/1112>\
**Category:** New to Julia\
**Created:** [December 23, 2016, 9:41am UTC](https://discourse.julialang.org/t/using-threads-with-i-o-to-processing-many-files-in-parallel/1112 "2016-12-23T09:41:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lwabeke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lwabeke/32/4005_2.png) [@lwabeke](https://discourse.julialang.org/u/lwabeke)\
**Post date:** [December 23, 2016, 11:48am UTC](https://discourse.julialang.org/t/using-threads-with-i-o-to-processing-many-files-in-parallel/1112/2 "2016-12-23T11:48:27Z")

</div>

I tried this. Seems to work for smaller number of parallelFiles.

Although, running it for 1000, I end up with only about 730-750 files.  
Rerunning a few times and I get the crash.

I am wondering if your running into the OS limitation of a maximum number of open files per process. Maybe if the GC is slow to fully close and clear some of the files.

---

_[View the full topic](https://discourse.julialang.org/t/using-threads-with-i-o-to-processing-many-files-in-parallel/1112)._
