ISC2 Certified Secure Software Lifecycle Professional (CSSLP) Practice Question

During a peer review of a C++ service, you notice several threads insert and delete entries in a shared std::map that is declared in global scope. Intermittent crashes and corrupted data have been reported in production. Which change will most effectively eliminate the race condition while keeping the code logic intact?

  • Recompile the code with maximum optimization flags (e.g., -O3) to streamline memory access.

  • Configure the runtime to spawn more worker threads so contention is less likely.

  • Increase the capacity of the map to reduce hash collisions and improve performance.

  • Guard all map insert, erase, and lookup operations with a mutex or similar lock.

ISC2 Certified Secure Software Lifecycle Professional (CSSLP)
Secure Software Implementation
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot