help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read access to std::map from multiple threads


From: Francis Litterio
Subject: Re: Read access to std::map from multiple threads
Date: Wed, 18 Jun 2008 15:15:05 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (windows-nt)

mathieu wrote:

>   I am currently having some very random seg faults. The few times
> where it seg fault this is somewhere during a read access to a
> std::map. Those accesses are concurrent (SMP machine). Is there
> something I need to do even for read only access ?

I assume that _something_ writes to the memory that is being read.
Given that, you'll need to synchronize all the readers and writers using
a mutex.
--
Fran


reply via email to

[Prev in Thread] Current Thread [Next in Thread]