Concurrent calls from SDL Studio 2017 to TranslationProviderLanguageDirection.SearchSegment(...) function

Hi --

I am building a Translation Provider plugin and it is mostly working. However, I am having a problem: Sometimes the wrong target translation gets returned for a source segment.

I could be mistaken, but it appears that SDL Studio 2017 is making parallel calls to my Translation Provider. For example, if I open the sample translation project in Studio, I can see from my log file that my function TranslationProviderLanguageDirection.SearchSegment(...) is called twice before the 1st translation result is returned.

Is there an easy solution for this problem? I understand the logic (prepare the translation of upcoming segments in advance to save the user time), but my particular Translation Provider can't process a 2nd segment while the 1st segment is still processing.

Any thoughts?

Thanks,

Gary Hess