
17 Dec
2009
17 Dec
'09
1:56 p.m.
El 17/12/2009 14:44, blp330 escribió:
Hi,
I must implement a multiple producer-consumer IPC application in win32 (but will port to linux in near future). I am wondering whether the boost::interprocess container like list, vector or map is thread-safe (actually, interprocess-safe?) or I need to use lock in my producer-consumer application?
They offer the same guarantees as standard containers: it's safe to read a container from two threads. It's unsafe to read and write it at the same time. You'll need to use locks/condition variables for that, just like you'll need to do for containers shared between threads of the same process. Best, Ion