Boost logo

Boost :

Subject: Re: [boost] Control of the file location for the boost::interprocess::managed_shared_memory object
From: Michael Watkins (condenser_at_[hidden])
Date: 2009-08-11 14:16:38


Ion:

I think that configurability through an environment variable would work fine. Any ability to set the path would help, but being able to provide an argument to the constructor or some similar functionality would be best for our situation.

Using All Users Documents and Settings seems like it would fix the service problem as well. But more options to set the location of the file would be optimal.

Thanks,

mlw

> Date: Tue, 11 Aug 2009 19:17:19 +0200
> From: igaztanaga_at_[hidden]
> To: boost_at_[hidden]
> Subject: Re: [boost] Control of the file location for the boost::interprocess::managed_shared_memory object
>
> Michael Watkins escribió:
>
> >>> Is it possible to control the exact location of the file that is backing the shared memory created by boost::interprocess::managed_shared_memory?
>
> No, sorry.
>
> >>> The issue occurs under Windows (it has not been tried yet under Linux). The problem is two processes attempting to connect to the same shared memory segment between two accounts, in specific from a program running as a service (using the system account) and a program running under a user account. The user account is running a program that needs to interface to the database that the service created.
> >>>
> >>> Everything seems to work fine, but the service will open the shared memory backing file in the global temp directory while the user account will open the file in their local settings temporary directory. Therefore two different segments are opened.
> >>>
> >>> The interim solution is to use boost::interprocess::managed_windows_shared_memory to create the shared memory, but the desire is to use the generic version for cross-platform compatibility. If the full file path could be specified when creating the memory segment, it would solve the problem.
>
> Soon to be released Boost 1.40 uses All Users Documents and Settings
> folder to build shared memory so that should work both for services and
> user processes.
>
> Adding configurability for the path would also be a good idea, maybe
> using an environment variable?
>
> Best,
>
> Ion
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=PID23384::T:WLMTAGL:ON:WL:en-US:NF_BR_sync:082009


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk