[shmem] Shmem version 0.9 available

Hi boosters! I've just uploaded the latest stable version of Shmem to boost sandbox vault (http://www.boost-consulting.com/vault/index.php?&direction=0&order=&directory=Memory) and boost sandbox cvs HEAD. This version finishes development changes previewed with the beta version posted the last day of December. Online documentation is available also as always here: http://ice.prohosting.com/newfunk/boost/libs/shmem/doc/html/index.html I would be glad if usual Shmem users could test it to see if there are portability problems, since I've tested it in linux/gcc-4.0.1 winxp/vc7.1. This version includes since the latest stable version (2005-10-12): -> Architecture and interface rework to allow future multi-segment shared memory support. -> Bug fixes and portability enhancements. -> Shmem iostreams to write/read formatted data directly to/from shared memory vectors/strings and memory buffers. -> Intrusive and scoped ptr for shared memory (I promise shared_ptr/weak_ptr for future versions, they are not ready yet). -> Better documentation, thanks to user suggestions. Enjoy! Ion P.D.: I can't login with my older "ion_g_m" account to sandbox vault. Would someone please delete files with "ion_g_m" username from Memory directory? Thanks.

On 1/27/06, Ion Gaztañaga <igaztanaga@gmail.com> wrote:
I would be glad if usual Shmem users could test it to see if there are portability problems, since I've tested it in linux/gcc-4.0.1 winxp/vc7.1. This version includes since the latest stable version (2005-10-12):
When I tried to upgrade shmem 0.9 in vault I am failing to compile on Cygwin using gcc 3.4.4 with the following error message. e:/boost/boost_1_33_1/boost/shmem/shared_memory.hpp:585: error: there are no arguments to `shm_open' that depend on a template parameter, so a declaration of `shm_open' must be available e:/boost/boost_1_33_1/boost/shmem/shared_memory.hpp:585: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) I went a head and added the following two lines to shared_memory.hpp after which I was able to compile. ========================================================= int shm_unlink(const char*); int shm_open(const char *name, int oflag, mode_t mode); ========================================================= Thank you Nitin Motgi

When I tried to upgrade shmem 0.9 in vault I am failing to compile on Cygwin using gcc 3.4.4 with the following error message.
e:/boost/boost_1_33_1/boost/shmem/shared_memory.hpp:585: error: there are no arguments to `shm_open' that depend on a template parameter, so a declaration of `shm_open' must be available e:/boost/boost_1_33_1/boost/shmem/shared_memory.hpp:585: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
I went a head and added the following two lines to shared_memory.hpp after which I was able to compile.
I didn't know that someone was trying to use this in cygwin! Last time I checked, cygwin had not PTHREAD_PROCESS_SHARED support so I thought Shmem couldn't work with cygwin. I'm wrong or has this changed? You've said "I tried to upgrade shmem 0.9" so I suppose you have tested previous Shmem versions. What was the latest version of Shmem that you could compile? I don't know much about cygwin but shared_memory.hpp header says: #if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) # include <boost/shmem/sync/win32/win32_sync_primitives.hpp> #else # ifdef BOOST_HAS_UNISTD_H # include <fcntl.h> //O_CREAT, O_*... # include <sys/mman.h> //mmap # include <unistd.h> //ftruncate, close # include <semaphore.h> //sem_t* family, SEM_VALUE_MAX # include <string> //std::string # include <sys/stat.h> //mode_t, S_IRWXG, S_IRWXO, S_IRWXU, # else # error Unknown platform # endif So if you have calls to shm_open in the code the #if (defined BOOST_WINDOWS) && !(defined BOOST_DISABLE_WIN32) condition should be true and since you don't get # error Unknown platform I suppose BOOST_HAS_UNISTD_H is true. And posix says # include <sys/mman.h> //mmap is enough to get shm_open and shm_unlink declarations. Can you investigate this a bit further? Thanks, Ion

I've just uploaded the latest stable version of Shmem to boost sandbox vault (http://www.boost-consulting.com/vault/index.php?&direction=0&order=&directory=Memory) and boost sandbox cvs HEAD. This version finishes development changes previewed with the beta version posted the last day of December. Online documentation is available also as always here:
http://ice.prohosting.com/newfunk/boost/libs/shmem/doc/html/index.html
I would be glad if usual Shmem users could test it to see if there are portability problems, since I've tested it in linux/gcc-4.0.1 winxp/vc7.1. This version includes since the latest stable version (2005-10-12):
Great to see you improving this already very useful library. It may be just a 'feature' of windows, but the shmemdoc-0.9.zip appears corrupt here in winrar, winzip and in explorer. lib file is fine. - unexpected end of file. Paul

Ion Gaztañaga escreveu:
Hi boosters!
I've just uploaded the latest stable version of Shmem to boost sandbox vault (http://www.boost-consulting.com/vault/index.php?&direction=0&order=&directory=Memory) and boost sandbox cvs HEAD. This version finishes development changes previewed with the beta version posted the last day of December. Online documentation is available also as always here:
http://ice.prohosting.com/newfunk/boost/libs/shmem/doc/html/index.html
I would be glad if usual Shmem users could test it to see if there are portability problems, since I've tested it in linux/gcc-4.0.1 winxp/vc7.1. This version includes since the latest stable version (2005-10-12):
I suggest supplying a default constructor to the shared memory Allocator (and generally making it compatible with the Allocator concept) in order to allow the easiest uses, like: std::queue<boost::shmem::allocator> global_queue; Maybe I could do that for you. -- Pedro Lamarão Desenvolvimento Intersix Technologies S.A. SP: (55 11 3803-9300) RJ: (55 21 3852-3240) www.intersix.com.br Your Security is our Business

Hi Pedro,
I suggest supplying a default constructor to the shared memory Allocator (and generally making it compatible with the Allocator concept) in order to allow the easiest uses, like:
std::queue<boost::shmem::allocator> global_queue;
But since a shared memory segment is dynamic (and because of that, the address is not known at compile time) how can the allocator know the address of the segment from where it has to allocate memory? Also, if the user opens more than one segment, you must say from which segment you want to allocate memory. If you have only one segment you could use a static object to tell so. This is a bit different from "operator new", because there is just one standard heap source and you don't need any handle to call global new. When allocating from shared memory, and since you can have multiple segment, you need dynamic data. But if you have any idea to initialize the allocator you think it's better than the current approach, I'm open to include it in Shmem. Regards, Ion

Ion Gaztañaga escreveu:
I suggest supplying a default constructor to the shared memory Allocator (and generally making it compatible with the Allocator concept) in order to allow the easiest uses, like:
std::queue<boost::shmem::allocator> global_queue;
But since a shared memory segment is dynamic (and because of that, the address is not known at compile time) how can the allocator know the address of the segment from where it has to allocate memory?
In the simplest of cases, the program (or the programmer) may not need multiple shared memory segments. My suggestion is for some kind of very simple default behaviour. Is it possible for the default constructed allocator in my example above use some default segment? -- Pedro Lamarão Desenvolvimento Intersix Technologies S.A. SP: (55 11 3803-9300) RJ: (55 21 3852-3240) www.intersix.com.br Your Security is our Business
participants (4)
-
Ion Gaztañaga
-
nitin motgi
-
Paul Baxter
-
Pedro Lamarão