# How to change the same DataFrame thought different threads

**URL:** <https://discourse.julialang.org/t/how-to-change-the-same-dataframe-thought-different-threads/28188>\
**Category:** New to Julia\
**Created:** [August 29, 2019, 11:25pm UTC](https://discourse.julialang.org/t/how-to-change-the-same-dataframe-thought-different-threads/28188 "2019-08-29T23:25:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BMval](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bmval/32/7647_2.png) [@BMval](https://discourse.julialang.org/u/BMval)\
**Post date:** [August 29, 2019, 11:25pm UTC](https://discourse.julialang.org/t/how-to-change-the-same-dataframe-thought-different-threads/28188/1 "2019-08-29T23:25:21Z")

</div>

How to change the same DataFrame thought different threads?

I have a simple example, but I use the same practics for large task, there are errors.  
So Would you suggest, the best practics, how to do it?  
Here is an example.

> function df\_add(dfram,d,id)  
> eigvals(rand(200,200))  
> @spawn push!(dfram,(d,id))  
> end
> 
> function test(df)  
> @threads for i in 1:100  
> df\_add(df,i,Threads.threadid())  
> end  
> end
> 
> df=DataFrame(Z=Int,id=Int)  
> @time test(df)
