
Hi,
Is there an example of using a shmem::map?
I'm getting:
C:\boost_1_33_1\boost\shmem\sync\win32\win32_sync_primitives.hpp(155) :
error C2668: 'boost::shmem::GetSystemTimeAsFileTime' : ambiguous call to
overloaded function
C:\boost_1_33_1\boost\shmem\sync\win32\win32_sync_primitives.hpp(105):
could be 'void boost::shmem::GetSystemTimeAsFileTime(_FILETIME *)'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\WinBase.h(3678): or 'void
GetSystemTimeAsFileTime(LPFILETIME)' [found using argument-dependent lookup]
while trying to match the argument list '(_FILETIME *)'
C:\boost_1_33_1\boost\shmem\sync\win32\win32_sync_primitives.hpp(215) :
error C2668: 'boost::shmem::GetSystemInfo' : ambiguous call to
overloaded function
C:\boost_1_33_1\boost\shmem\sync\win32\win32_sync_primitives.hpp(117):
could be 'void boost::shmem::GetSystemInfo(_SYSTEM_INFO *)'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\PlatformSDK\Include\WinBase.h(3706): or 'void
GetSystemInfo(LPSYSTEM_INFO)' [found using argument-dependent lookup]
while trying to match the argument list '(_SYSTEM_INFO *)'
when i try to compile
boost::shmem::map

I have found that putting
#include "boost/shmem/containers/map.hpp"
#include

Another question! The shared memory library is great Ion Gaztañaga and others have created outstanding work. Is a shmem container thread safe, I am assuming not but just wanted to check. I basically need to know if I am using the right syntax for the shmem map (see previous posts), the header issue has a work around and is probably easy to fix. Thanks in advance Jan

Hi Jan,
Another question! The shared memory library is great Ion Gaztañaga and others have created outstanding work.
Is a shmem container thread safe, I am assuming not but just wanted to check.
Is not thread-safe. Is exactly as thread safe as a normal STL container shared between threads. Only object construction (construction/find,) and memory allocation is thread-safe. Shmem containers are STL compliant containers capable of using advanced allocators. So if you want to insert objects in a containers from two process/threads, you need to hold a mutex first. Regards, Ion

I want to get the latest version of shmem off the sandbox cvs but when i checkout it only gives me a few files.

It looks like the shmem::map needed me to supply the less predicate to it. This is only documented in an unrelated example. Supplying the predicate may be clear to an expert but not everyone. Although I have found these problems with shmem: The header ambiguity (see previous post). That you have to include boost/shmem/exceptions.hpp before named_mutex.hpp, i think the author is aware of this from looking at the developer mailing list. shmem::scoped_lock doesn't work with shmem::named_mutex, hopefully it will soon! I have been working with the latest sandbox cvs Keep up the good work! Jan

Hi Jan, Sorry for not replying your posts. I wasn't reading users mailing list. Now that Shmem is accepted I think it's time to do it! I will try to look these issues soon. I plan a new bug-fix version next week, so I hope to solve your issues. Regards and thanks for using the library! Ion
participants (2)
-
Ion Gaztañaga
-
Jan Stetka