Go Back   The UNIX and Linux Forums > Top Forums > Programming
.
google site



Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-24-2002
Registered User
 

Join Date: Dec 2001
Posts: 14
Question Sharing C++ Objects with virtual function table pointers

I am pondering the next question:
Can I safely sare objects that have virtual functions (i.e. have
virtual function table pointers) between two processes ?
Where will the pointers point to in each process ?
What I am afraid of is that in the creating process the pointer
will indeed point to the virtual function table, but in the
sharing process that pointer will point at junk.


Can anyone calm me or maybe confirm my fears ?

Thank you !
Sponsored Links
  #2 (permalink)  
Old 01-24-2002
Registered User
 

Join Date: Nov 2001
Posts: 60
If the virtual function table is in process A, then the pointer to the table is in the process address space of process A and has no meaning in process B, so if you pass the pointer to process B, it would be meaningless. I don't know what OS you're using, but have you thought of using shared libraries to share the code. If that isn't an option, what about shared memory?
  #3 (permalink)  
Old 01-27-2002
Registered User
 

Join Date: Dec 2001
Posts: 14
more about shared objects

Hi, to be more specific :
I am using AIX on R6k, and shared memory is an option.
How can that approach solve the problem ? Isn't szared memory
mapped into each process's vitual address space anyway ?
And what is the deal about shared libraries ? what are those ?
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pointers Milla Programming 2 11-03-2007 05:13 AM
Pure Virtual Function in C++ krishna_sicsr Programming 1 06-03-2007 05:11 PM
pointers areef4u Programming 4 08-05-2006 06:08 PM
sharing of IP address for load sharing avoiding virtual server & redirection machine Rakesh Ranjan IP Networking 2 08-25-2005 02:45 PM
Regarding Function and Pointers. S.Vishwanath Programming 0 05-25-2004 09:15 AM



All times are GMT -4. The time now is 12:15 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0