Many cases I want to read thousands of files and do some processing, or conversion, on each file. I’m assuming I can use @threads to do this, however below test case crashes Julia (seg fault below).
function parallelFile(N::Int64) dPath="/tmp/Jason/" Threads.@threads for i=1:N tFile=*(dPath,"file_",@sprintf("%015d",i)) f=open(tFile,"w") @printf(f,"%s\n",Dates.format(now(),"SS.ssss")) close(f) end end @time parallelFile(10000)
signal (11): Segmentation fault: 11
while loading no file, in expression starting on line 184
unknown function (ip: 0x11453452f)
Allocations: 1467627 (Pool: 1466754; Big: 873); GC: 0