Re: std::queue
От: Esperar  
Дата: 12.10.04 05:49
Оценка:
Здравствуйте, Аноним, Вы писали:

А>Является ли потоково безопасным сабж. Т.е. могут ли много потоков вставлять и удалять элементы из одного объекта-контейнера. Есть ли там критические секции и их локи/анлоки. Спасибо!!!

а в MSDN написано:
Container Classes (vector, deque, list, queue, stack , priority_queue, valarray, map, multimap, set, multiset, basic_string, bitset) and complex
For reads to the same object, the object is thread safe for reading:

From one thread at a time when no writers on other threads.
From many threads at a time when no writers on other threads.
For writes to the same object, the object is thread safe for writing from one thread when no readers on other threads

For reads to different objects of the same class, the object is thread safe for reading:

From one thread at a time.
From one thread at a time when no writers on other threads.
From many threads at a time.
From many threads at a time when no writers on other threads.
For writes to different objects of the same class, the object is thread safe for writing:

From one thread when no readers on other threads.
From many threads
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.