[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
STL and multithreading
From: |
Carlos Martinez |
Subject: |
STL and multithreading |
Date: |
Mon, 24 Sep 2007 04:15:01 -0700 |
User-agent: |
G2/1.0 |
I want to know if gnu g++'s STL implementation is thread safe or not.
If it's not thread safe I want to know hou you deal with the problem
of multithreading.
Initially I suppose that protecting all access to an STL containter
with mutexes, I can resolve the problem, but I have a doubt about it:
Memory allocation.
I can protect with a mutex access to a resource (for example an STL
container), but the default allocator can be accessed concurrently
from several containers and/or instances of a concrete container, and
I haven't the control of it.
There are other techniques for efficiency, as sharing implementation
(with reference counting) that I suppose that can have problems with
multithreading but I don't know if g++'s STL implementation uses that
kind of techniques.
Thanks in advance.
- STL and multithreading,
Carlos Martinez <=