Title: | *OLD* ALL-IN-1 (tm) Support Conference |
Notice: | Closed - See Note 4331.l to move to IOSG::ALL-IN-1 |
Moderator: | IOSG::PYE |
Created: | Thu Jan 30 1992 |
Last Modified: | Tue Jan 23 1996 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 4343 |
Total number of notes: | 18308 |
Hi, I have written a simple editor that uses only part of the screen. Used inconjunction with a form that uses only part of the screen it allows a 'quick' mail message to be created and sent. This application is an external application linked at run time with the INSTALL command. All works fine until two user's use it at the same time. When this occurs strange things happen or one or both get an error in external application message (an accvio I think). I am not used to writing code for shared images and the VMS manuals talk about copy on reference and non copy on reference sections and other weird and wonderful low level things that I don't have a tight grasp of. So am not 100% certain I have written /installed it so that the two users are not using common data memory. The program is written in C and manipulates 6 data elements that aren't local to functions (and thus I suspect may be shared). Their definition follows: struct BUFFER /* used to store the text */ { struct BUFFER *flink, *blink; char s[MAXLINELEN+1]; short unsigned int flags; } *buffer; struct WINDOW /* used to maintain screen info for cursor positioning */ { int top, length, x, y; } static int (*A1CB)(); /* store the address of the callback routine */ static int status; static int mode; The image is installed /share /write. I know this is very sketchy infobut is it likely that a memory conflict is occuring between users? Regards, ajb
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1273.1 | Make sure the PSECTs are set up correctly | SHALOT::DUNCAN | Joe - CIS/EIC Doc. Mgmt. Solution Set Consultant | Wed Aug 19 1992 21:47 | 4 |
You might want to add lines to the linker options file that force the static data structure PSECTs to be NOSHR, LCL. Joe Duncan @ OPA | |||||
1273.2 | Been there, done that | IOSG::TALLETT | Arranging bits for a living... | Thu Aug 20 1992 11:03 | 22 |
Yes, a few people have seen this one before I'll wager! Let me guess, you tried to install your image and INSTALL said it wanted the /WRITE qualifier so you gave it the /WRITE qualifier and now it breaks, right? Yes, you are right, you now have a shared data area for all your users which corrupt each other. The problem is caused by the fact that 'C' generates the "wrong" PSECT attributes for your data PSECTS by default. It makes them SHR. This dates back to the days of FORTRAN global common blocks and the desire to be compatible with them, and now we're stuck with the default. You *HAVE* to get the image to install without /WRITE. The way you do it was given in .1, you take a map and scan through it for data segments marked SHR and force them to NOSHR with PSECT directives. This has been discussed before in this conference I think. Regards, Paul |