title: different results using one core and multiple cores to modify data.table
body: <p>I found something very confusing when I use multiple processing to modify values in R data.table.</p>
  
  <p>I tried to modify value in place by using a function. It works well using one core, and the values in data.table were successfully changed. But when I used multiple cores, it failed to change the value in data.table.</p>
  
  <p>That makes me very confused. Anyone know why? </p>
  
  <pre><code>library(data.table)
  library(parallel)
  aa &lt;- as.data.table(iris)
  aa[,tt:=0]
  # modify aa$tt in place
  main &lt;- function(x){
    #set(aa,x,6L,5)
    aa[x,tt:=5]
    return(NULL)
  }
  
  # aa$tt changed
  mclapply(1:nrow(aa), main, mc.cores = 1)
  
  # aa$tt unchanged
  mclapply(1:nrow(aa), main, mc.cores = 2)
  
  </code></pre>