Ask a Question related to UNIX Programming, Design and Development.
-
curious_one #1
single object across processes
Hi,
Is there a way to access a single instance of an object(singleton
class) across different processes ?
thanks
curious.one
curious_one Guest
-
Binding a single object to a control
Hi all, This probably sounds like a stupid question, but what is generally the recommended way to display a business object in the aspx file for... -
double coordinates on a single object
Hi All, i have to create a big floor with a tiled texture on it ( a museum floor) Then i have to create a big lightmap on this floor with the... -
HOW TO: Create a single DataSet bound object used by 50 DropDownList box controls in the same web form. CSHARP
I have a seating chart web form that has over 50 entry field controls (tables/booths) where I use a DropDownList box to select a single company... -
Dependencies on single object files in a library
Problem's as follows: I've got a static library libabc.a made of a.o, b.o and c.o, which in turn were created from a.h/.C, b.h/.C and c.h/.C,... -
Multiple object types in a single .pm?
I have two very closely related classes that I'd like to implement in a single .pm. I realize that the usual setup is that if you're going to do... -
curious_one #2
single object across processes
Hi,
Is there a way to access a single instance of an object(singleton
class) across different processes ?
thanks
curious.one
curious_one Guest
-
Gianni Mariani #3
Re: single object across processes
curious_one wrote:
cross posting to 4 groups is going to annoy some people.> Hi,
> Is there a way to access a single instance of an object(singleton
> class) across different processes ?
> thanks
> curious.one
comp.lang.c++ answer : c++ has no knowledge of process. What your
question got to do with the c++ language ?
comp.unix.internals : what's an object ? what's a singleton ?
comp.unix.programmer : no answer
comp.unix.solaris : java has JVM's and you can't do anything a JVM can't
do !
So the true answer to your question is that if you want to share a
singleton you need to allocate it in shared memory. Now you run into
problems of address mapping. The object may be in a different address
in different processes. Not only that, any virtual methods almost
certainly will cause trouble since they won't be mapped to the same
addresses either (if they exist at all).
So far, your singleton is very limited in ability.
So, if you're still interested because this is really what you need,
then you may get some help from some mutex library.
So there are some C++ template classes that could help (like a
relocating smart pointer that relocates addresses dynamically) and a few
others to deal with finding the right methods in a process.
More than this is hard to specuate ...
G
Gianni Mariani Guest
-
Gianni Mariani #4
Re: single object across processes
curious_one wrote:
cross posting to 4 groups is going to annoy some people.> Hi,
> Is there a way to access a single instance of an object(singleton
> class) across different processes ?
> thanks
> curious.one
comp.lang.c++ answer : c++ has no knowledge of process. What your
question got to do with the c++ language ?
comp.unix.internals : what's an object ? what's a singleton ?
comp.unix.programmer : no answer
comp.unix.solaris : java has JVM's and you can't do anything a JVM can't
do !
So the true answer to your question is that if you want to share a
singleton you need to allocate it in shared memory. Now you run into
problems of address mapping. The object may be in a different address
in different processes. Not only that, any virtual methods almost
certainly will cause trouble since they won't be mapped to the same
addresses either (if they exist at all).
So far, your singleton is very limited in ability.
So, if you're still interested because this is really what you need,
then you may get some help from some mutex library.
So there are some C++ template classes that could help (like a
relocating smart pointer that relocates addresses dynamically) and a few
others to deal with finding the right methods in a process.
More than this is hard to specuate ...
G
Gianni Mariani Guest



Reply With Quote

