[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference iosg::all-in-1_v30

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

1273.0. "External app fails with multiple users" by WPOPTH::BEESON (Down Under in the bottom left corner) Wed Aug 19 1992 17:42

    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.RTitleUserPersonal
Name
DateLines
1273.1Make sure the PSECTs are set up correctlySHALOT::DUNCANJoe - CIS/EIC Doc. Mgmt. Solution Set ConsultantWed Aug 19 1992 21:474
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.2Been there, done thatIOSG::TALLETTArranging bits for a living...Thu Aug 20 1992 11:0322
    
    	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