[Info-vax] Basic & Global sections

Bob Gezelter gezelter at rlgsc.com
Thu Nov 4 20:05:00 EDT 2021


On Thursday, November 4, 2021 at 12:30:26 PM UTC-4, jdo... at gmail.com wrote:
> Hey all, 
> 
> I've been playing with some inter-process communication via Basic using a global section. It all works very well except for one thing - data in an array. Everything else comes across nicely - strings, longs, etc. But anything in an array written by one process never shows up in the other. 
> 
> Is there something inherent in the structure of a Basic array that doesn't work in a global section? 
> 
> I've also tried an installed shared psect image and that works OK. 
> 
> -John
John,

I agree with many of the thoughts expressed by Hoff.

I have a bit of experience with BASIC, several clients have been very BASIC-centric. Combining shareable storage with BASIC and other languages always requires a serious degree of caution.

First, just compiling and linking is more involved, the sources have follow explicit guidelines to have the common areas actually shared between processes, and persist if one process terminates. You also need the tools to reset the shared area and other utility tasks. Manipulating data in the common area similarly requires caution, timing errors are difficult to reproduce. The various interlocked instructions must be used religiously.

Performance wise, the complexity often is not needed. Local TCP/UDP links, local DECnet links, even mailboxes have higher overhead than shared memory, but one must consider the actual traffic volume. On even slow systems, e.g. first generation Alpha CPUs, I could process tens if not hundreds of thousands of requests/second using network links while avoiding all of the difficulties of using shared memory.

Been there, done that. My recommendation is that it is a path to be avoided if at all possible. There are better ways to accomplish almost all of the requirements.

- Bob Gezelter, http://www.rlgsc.com



More information about the Info-vax mailing list