Hello,
I was hoping to use mstoolkit in a multi-threaded (with a private MSReader object per thread), but ran into issues. So far, I noticed the following needs to be changed:
So far, I quickly patched the above changes, and things seem OK. But at the moment I am also only using just the mzML part of the library. If more issues will arise, I will update this issue again.
Thanks,
Rick
edit1: I made the issue more generic for threading after noticing more issues.
Hello,
I was hoping to use mstoolkit in a multi-threaded (with a private
MSReaderobject per thread), but ran into issues. So far, I noticed the following needs to be changed:strtok_s()(Windows) orstrtok_r()instead ofstrtok(), as the latter uses a static buffer and is therefore not thread safe. See e.g. https://stackoverflow.com/a/54702249lLastScanIndexvariable defined inmzParser.his static. Moving this to a member variable ofRAMPFILEseems like a proper solution.So far, I quickly patched the above changes, and things seem OK. But at the moment I am also only using just the mzML part of the library. If more issues will arise, I will update this issue again.
Thanks,
Rick
edit1: I made the issue more generic for threading after noticing more issues.