tags:

views:

70

answers:

1

Simple question - is the C++ API provided by Perforce thread-safe? There is no mention of it in the documentation.

By "thread-safe" I mean for server requests from the client. Obviously there will be issues if I have multiple threads trying to set client names and such on the same connection.

But given a single connection object, can I have multiple threads fetching changelists, getting status, translating files through a p4 map, etc.?

+2  A: 

If the documentation doesn't mention it, then it is not safe.

Making something thread-safe in any sense is often difficult and may result in a performance penalty because of the addition of locks. It wouldn't make sense to go through the trouble and then not mention it in the documentation.

Wim Coenen
That's a good point. Though on the performance front, given that the overwhelming cost of doing any query is going to be server response and network transfer time, I was thinking that the API would be as safe as possible. Still, if they don't mention it, it's better to assume it's not safe, as you say.
Scott Bilas