Multi-threading

Hi, If we create 10 threads to invoke runQuery method at same time, Will queryProcessor will be overriden sometime or 10 different copies will be created?

We are not using any sunchronzation mechnism in runQuery(). so there is not gurantee on QueryProcessor class variables right OR each 10 threads will maitain 10 uniq objects?

Can some comments on this what will happens to the class QueryProcessor variables when no sychronization.

1017 static void * runQuery(void *args)
1018 {
1019     QueryProcessor *queryProcessor = (QueryProcessor *)args;
1020
1021     int *statusPtr = new int;
1022     *statusPtr = queryProcessor->runQuery();
1023
1024     return statusPtr;
1025 }

You don't get copies unless you create them yourself, there's nothing intrinsic about threading which does it for you. (That's kind of the point of threading, really.) So yes, if you give 10 threads the same object with no synchronization, that's a race condition.