Objects reuse when working with Microsoft Information Protection SDK

Viewed 11

TL;DR

Is it safe to share MIP File Engine object between multiple threads, each will use it to read a label from a different file?

The Longer Version

I'm working with Microsoft Information Protection SDK (from now on, I'll call it MIP) in order to develop a C# service that checks whether files are correctly labeled.

In order to check this, I need to create 3 objects:

  1. MIP Context
  2. Profile Engine
  3. File Engine

Microsoft documentation says regarding the MIP context that every process should construct only one context and it should reuse it, but, regarding the other two, I wasn't able to find any mention regarding concurrency / thread safeness / objects reuse.

It is expensive to create them for each request I'm serving. It can take up to 2-3 seconds just to construct the file engine.

What I tested? I assumed it is thread safe and used those objects concurrently while stress testing the system and it looks like everything works just fine, which is promising but I need more than that.

Thanks for the help!

0 Answers
Related