GetPKey doesn't work *sometimes*

I've been encountering a rather strange error since I decided to start using the GetPKey function. Most of the time, it works just fine (it returns TA_OK). But, let's say, 1 out of every 20 times I run my app, it returns TA_E_PKEY. Is there any reason it would happen like this? I can't for the life of me understand why it would work most of the time but not always. Thanks for any advice.

Well, I'll start with the basic questions:

1. What programming language are you using?

2. What version of TurboActivate are you using?

3. Why are you calling GetPKey() so often -- what are you using the function for -- if you tell me how you use the function we might be able to reproduce this.

4. Are you calling this function in a thread separate from other TurboActivate calls? If so, don't. TA 3.x is not thread safe. TA 4.x and newer are.

Ok thanks, I think that answers the question. I am using the C interface on 3.4.6. I couldn't find any documentation on thread safety. But yes, I was calling it from a different thread, so I guess that's the problem.

...But just to clarify, are you saying that *none* of the TurboActivate functions are thread-safe? Or just GetPKey()?

And 4.0 isn't available yet right? At least I don't see it on the API page.

I was using GetPKey() in one of my activation checks. Is there an additional separate problem with calling it more than once?

...But just to clarify, are you saying that *none* of the TurboActivate functions are thread-safe? Or just GetPKey()?

None of the functions in TurboActivate 3.x are thread safe -- you can wrap mutex around them and ensure no 2 functions are called at the same time.

In TurboActivate 4.x, all the functions are thread safe.

I was using GetPKey() in one of my activation checks.

How so? Can you give me a code snippet. Normal activation checks shouldn't use GetPKey() at all. In fact, the only time you might want to use that function is for informational purposes for a customer (i.e. telling them what their product key is).

And 4.0 isn't available yet right? At least I don't see it on the API page.

Not yet.

Is there an additional separate problem with calling it more than once?

Nope. You should be able to call it infinite times with no problem.

Ok, thanks for that information. I realized it was possible in my app for two TurboActivate functions to be called at the same time from different threads. Issue solved! 🙂