- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How to Share the variable between two .exe's [ com...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 05:38 PM
тАО08-27-2007 05:38 PM
How to Share the variable between two .exe's [ compaq C on VMS]
Please explain how the Globaldef & globalref will work?
I need to define a variable which can share between [globally ] two exe's in Compaq C on VMS.
I heard about globaldef and globalref for defining a variable globally & using it.
But im not able to share this variable
with "two different executables."
Please reply me if you have any idea on this.
Byebye
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 05:44 PM
тАО08-27-2007 05:44 PM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
Share a variable betzeen two exe's?
Do you mean two different programs running in the context of two different processes?
If so, an option would be to use the system services $CRMPSC and $MGBLSC.
The "globaldef/globalref" constructs are used to declare variables globally to your program, their scope does not extend beyond the program.
Regards,
Kris (aka Qkcl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 06:08 PM
тАО08-27-2007 06:08 PM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
Yes. share the variables between two exe's.
Yes. Two different programs running in the two diffreent executables.
can you tell me more on this $CRMPSC and $MGBLSC and how it will work if you know.
[or] Is there any other way?
Thanks for your reply.
Bye
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 10:25 PM
тАО08-27-2007 10:25 PM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
Describing CRPMSC and MPGBLSC are both fully documented in the "OpenVMS System Services Reference Manual" and the "Programming Concepts Manual", both of which are available online via the documentation section of the OpenVMS www site at http://www.hp.com/go/OpenVMS
I would rather that you review the documentation in depth before using them. Personally, I have seen more problems caused by sharing variables between programs, particularly in multi-processor contexts, which are now common, than I care to think about.
Sharing variables between two (or more) programs in different executables safely requires extremely carefully thought out safety precautions. Use of the Lock Manager or proper semaphores is critical. There are also issues of propagating problems from one user to another.
Personally, in almost all cases, I have found it sufficiently efficient to use a variety of techniques including: Lock Manager values, DECnet logical links, TCP/IP pipes, and other mechanisms to pass data between cooperating processes in total safety, without having to resort to the hazards of direct sharing of memory locations.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 10:47 PM
тАО08-27-2007 10:47 PM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
The more classic/easy way for two executables (A, B) to share data is to use a third one (C) "Common" with just data in a shareable image created with LINK/SHARE. This is all well documented in the OpenVMS concepts, language users guides and Linker reference manual.
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 11:42 PM
тАО08-27-2007 11:42 PM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
While I was directly responding to Kris' comment, Hein is correct. However, the issues that I view as a concern are just as applicable to the static sharing through the use of the LINKER as to the dynamic sharing facilitated by mapping the section dynamically.
In both cases, extreme care must be exercised to prevent errors, and these errors are subtle and difficult to reliably detect. I have seen far too many cases where these problems survived for many, many years, occasionally appearing and just as quickly disappearing, until somebody by chance realized what the problem is.
I always recommend that clients use other alternatives (as noted) before resorting to memory sharing between processes. In almost every case that I have had to explore, the "efficiency" savings of shared memory are insufficient performance gains when compared to the costs of developing and debugging the code.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2007 11:50 PM
тАО08-27-2007 11:50 PM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
Thanks for your reply.
I think you people have reached greater extend level.
But, i just need to set a flag by one variable in one EXE. And this flag is taken by the another EXE.
So please provide your suggestions on this.
bye
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2007 12:31 AM
тАО08-28-2007 12:31 AM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
> But, i just need to set a flag by one
> variable in one EXE. And this flag is
> taken by the another EXE.
This sounds like inter-process synchronization.
There are a number of techniques available under VMS (as my learned colleagues have pointed out). You can use the lock manager, common event flags, logical names, mailboxes.
Please see the programming concepts manual at:
http://h71000.www7.hp.com/doc/82FINAL/5841/5841PRO.HTML
Regards,
Kris (aka Qkcl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2007 01:02 AM
тАО08-28-2007 01:02 AM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
So what problem do you really want to solve.
What's the flag going to do.
Should it interrupt or will it be polled?
For polling...
The 'classic' solution to set a flag in an other process is to use a COMMON EVENT FLAG CLUSTER. Check out the same concepts manual again, or the SYSTEM SERVICE REFERENCE MANUAL. For a sneak preview: $HELP SYSTEM $ASCEFN
LOCKs can be used both for polling and interrupst. Check out BLOCKING AST's.
Ditto for MAILBOX IOs. You can poll with QIO IO$M_NOW to see if there is a 'command' or set up a WRITE ATTENTION AST.
Important questions to consider
- Will those processes share the same GROUP or will they be WORLD to each other?
- Are those images in the SAME JOB? (sharing a job logical name table?
- Security / Privs available?
Many more alternatives for polling are LOGICAL NAMES.
Or, here is a cute one... process names.
The first image could call itself "Hey you: GO" and chage that to "Hey you:STOP" as needed. The second image could poll that.
btw.. if the reall proble you are trying to solve is a stop/go issue, then the ideal communication is the system service combo $HIBER/$WAKE
Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-28-2007 01:13 AM
тАО08-28-2007 01:13 AM
Re: How to Share the variable between two .exe's [ compaq C on VMS]
And I failed to start asking my normal opener 'what problem are you really trying to solve'. Judging by the follow up, Bob rightly pointed to several interprocess communication techniques in anticipation of the underlying problem.
btw... we didn't really answer the actuall question asked even though that might not solve the real problem:
>> Please explain how the Globaldef & globalref will work?
Typically it works between two modules in a single executable, or a shareable (image) module defining the images and other moduleing linking against that.
One source module, defines a variable and and other indicates it wants to use it. The compiler can NOT resolve that, only carry it forward as a request in the Object it produces. It is the LINKER which resolves the globalref, 'seeing' the globaldef from the other module.
Cheers,
Hein.