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 6852217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:20:40+00:00 2026-05-27T01:20:40+00:00

Simplified: I am writing plugins to realbasic. I have two plugins with their own

  • 0

Simplified:
I am writing plugins to realbasic. I have two plugins with their own threads. Everything is fine until i start to use std::vector. I have vector<> variables in both plugins and I am not using the vectors to use same data or to share data between threads or anything else. My model looks like this:

thread_1{
    vector<> variable_1;
    foreach{
         variable_1.push_back(something);
    }
}


thread_2{
    vector<> variable_2;
    foreach{
         variable_2.push_back(something);
    }
}

If I don’t declare the vectors static, the program most of the times crashes. But even when i declare the variables static, and use some of algorithms like sort or copy, the crashes appear again.
It seems like the operations on vector are using some abstract class which is not multithread safe or something. Or am I doing something wrong?
Thank you.

I am using windows 7 x64, visual studio 2008 pro, compilation on release win32.

  • 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-05-27T01:20:41+00:00Added an answer on May 27, 2026 at 1:20 am

    AFAIK, the allocator is not thread safe. You should either allocate vector (reserve) in a thread safe way or use a thread safe allocator.

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

Sidebar

Related Questions

Simplified for example, I have two tables, groups and items . items ( id,
In an algorithm I'm writing, I can have the following (simplified of course) int
I am writing some unit tests which I have simplified to the following: class
Blocks are fine but what about writing C arrays? Given this simplified situation: CGPoint
A simplified example here: I have a game that I am writing in opengl
I'm writing a simplified Pascal parser/interpreter and now I'm thinking about segmentation faults. I'm
I am starting a project of writing a simplified shell for linux in C.
I am writing a C# control that wraps DirectX 9 and provides a simplified
I'm writing code to present the user with a simplified network map. At any
This is a simplified version of a class I'm writing a unit test for

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.