Re: Help with containers, pointers, and threads.



I apologize. meant to post this in the BCB forum.
Mike Margerum wrote:
Hi guys, I have a C++ app right now that is currently not threaded. I use pointers to elements in maps and vectors. As I understand it, the pointers could be invalidated if I had say, a thread, adding items to the map or list in the background right?

A solution to this would be to use copies of the object to be truly safe which is fine but would increase my memory footprint.

My question is, would C# references have the same problem? Are the references automatically updated if the object is moved around in the container? What about java?

Are the .net collection classes thread safe?

Are the java collection classes thread safe?

Thanks for the help!

.



Relevant Pages

  • Help with containers, pointers, and threads.
    ... I use pointers to elements in maps and vectors. ... Are the .net collection classes thread safe? ...
    (borland.public.delphi.non-technical)
  • Re: Run-time representation of classes
    ... byte or word maps rather than bits). ... which may hold any number of useful function pointers. ... for the tagged reference would be). ... for simple object types, the GC calls a "mark handler", which is a special ...
    (comp.compilers)
  • Re: Biz Tree Challenge
    ... is a programming technique that involves tables of pointers to ... relational rules make it easier to follow and disect structures. ... OO is generally maps of pointers to maps. ...
    (comp.object)
  • Re: Sorting a map by value
    ... >> You can't sort maps. ... >What are the arguments to this functor (values, pointers or ... The same as to std::less, namely (const reference to) key_type, and it ...
    (comp.lang.cpp)