Segmentation fault in multi thread code

Hmm, I can’t see anything here which could cause a segfault, only several things which will slow things down.

Could it be that npzread/npzwrite does something dubious? Could you try serialize/deserialize instead (with using Serialization).

And what’s the output of versioninfo()?