Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8108499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:07:47+00:00 2026-06-06T01:07:47+00:00

I am working on a project in C++ that uses self created maps to

  • 0

I am working on a project in C++ that uses self created maps to store data – maps in this sense would be more like a “geographical” map, so an image. There are different threads reading from and writing to it. The data of a map is stored in an std vector of vectors of integers. Its size does not change, only the content of certain pixels through getter and setter functions.

My problem is the following:
Sometimes everything works just fine, but more often I get corrupted images, in the sense that the value of a pixel changes sign or become completely different from what they should be. Could this be an issue of the threaded read/write access to the pixels, if so what should I use instead of the standard vectors?
I have tried using mutex to ensure that only one thread reads or writes to the vector, however these read/write operations happen so often, that the application becomes too slow if I lock the vector at every operation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:07:50+00:00Added an answer on June 6, 2026 at 1:07 am

    You will need some kind of locking. To prevent that from hurting your performance too badly, you should try to make the scope of the locks as small as possible. For instance, you could lock individual row-vectors, so that writes on different rows would not interfere with each other. What kind of solution is most appropriate for you depends on your access-patterns and platform.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a project that uses TestNG and ant. I would like
I'm working on a project that uses Linq2SQL for data access. The project is
I'm working on a project that uses lots of external libraries. Now, I like
I'm working on a project that uses svn, but I like the way mercurial
I am working on project that uses this pattern var businessEntity = new DAL().GetObject(id);
I'm working on this project that uses proxy server and curl in c and
I'm working on a project that uses several languages: SQL for querying a database
I'm working on a project that uses the new CSS3 transform:rotate(180deg) feature. Every modern
I am working on a project that uses Java Swing. The default look and
I'm working on a project that uses dependency injection via Ninject. So far, it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.