Question: These two programs (C++ and Java) both do the exact same assignment. They both count up to 20 with one thread and down to 0

These two programs (C++ and Java) both do the exact same assignment. They both count up to 20 with one thread and down to 0 with the other. Which one is a more reliable to use and why when it comes to security vulnerabilities? Any explanation on the following would be great. Please explain, 

  • Performance issues with concurrency
  • Vulnerabilities exhibited with use of strings
  • Security of the data types exhibited.
#include #include #include #include Busing namespace std; using namespace chrono; using namespace

#include #include #include #include Busing namespace std; using namespace chrono; using namespace this_thread; int counter = 0; E//condition_variable cv; [//mutex m; Evoid add() { B while (counter

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!