forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Shared memory

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
arla



Joined: 18 Apr 2005
Posts: 3

PostPosted: Sun May 08, 2005 1:58 pm    Post subject: Shared memory Reply with quote

I did put this question under "General" some weeks ago, with no respons, so now I try this forum:

I have ported an old application to FTN95 which has a long history over the last 23 years. Starting om UNIVAC 1100, moved to VAX/VMS, Norsk Data, UNIX, Linux, and now finally to WINDOWS/Salford. On all OS it has been simple to create shared memory, so that several processes can share the same data, but on WINDOWS/XP I canīt find out how to do!

Any help out there?

Sad(

arle
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon May 09, 2005 2:57 am    Post subject: Shared memory Reply with quote

Can you be more specific?
How does this work on other operating systems?
For example, is the data shared via common COMMON BLOCKs with some mechanism for communicating the shared base address?
Back to top
View user's profile Send private message AIM Address
arla



Joined: 18 Apr 2005
Posts: 3

PostPosted: Mon May 09, 2005 4:44 am    Post subject: Shared memory Reply with quote

Yes, in some OS the data was placed in common blocks and became shared by commands to the linking process.

In UNIX by using the system calls shmget (get shared memory) and shmat (to attach the shared memory to the data segment). Then several processes can share the data area, but ocause you also need some handshaking when updating the data in this area.

Arne

Neutral
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue May 10, 2005 3:25 am    Post subject: Shared memory Reply with quote

The nearest I can get to this situation is to wrap a MODULE around a COMMON BLOCK and to put the module in a DLL. An executable that accesses the DLL can then USE the data in the common block.

There is currently no mechanism for making a COMMON BLOCK (in an executable) "external" so that it can be linked to a common block whose memory is allocated in a DLL (nor for sharing COMMON BLOCKs between DLLs etc).

You might be able to allocate memory for a single array using GET_STORAGE@ (this uses the API function GlobalAlloc which allocates memory from the global heap which all applications share). You could then use the registry (say) to pass this address to another application or DLL. You would then need to pass this address to a SUBROUTINE within which the array is defined. All very complicated I am afraid.

A redesign with one executable and one or more DLLs seems more feasible.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group