Link to home
Start Free TrialLog in
Avatar of chicho12
chicho12

asked on

thread-safe code in c++

I was asked to make a calculator code thread-safe.  The program is written in c++ and the IDE is Visual studio 2012.
I created a web application that references the c++ dll in order to test this.  Using Curl i can send multiple requests to the web app at the same time.
Initially before I made any changes to the calculator I was getting a mix of results (numbers) when sending multiple requests. After making some changes now the numbers look correct when doing multiple requests, but there is a section in the answer that contain messages and that section is still coming incorrect.  The messages from one request seem to show in another request and vice versa.

The Calculator is made up of several C++ classes. The changes I made so far were to remove some static variables I found in some functions.  I cannot find any more static variables.

Can anyone give some suggestions of what else I should be looking for to make this code thread-safe?

Thank you!!
SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial