Purpose of OWN Clause
You must take a special precaution when declaring arrays with an OWN clause in an exported library procedure. The OWN clause, which is available only in ALGOL, causes the value of an object to be saved between invocations of the procedure in which that object is declared. If multiple invocations of the procedure are running simultaneously, the OWN clause also causes all invocations of the procedure to access the same instance of the object.
OWN Array Restrictions
If an exported procedure includes an array declaration with an OWN clause, then the server library program should itself invoke the exported procedure before any client process invokes the procedure. If a client process invokes the procedure before the server library does, then the system discontinues the client process with the error “ILLEGAL OWN ARRAY.” The server library process itself is not affected by this error.
OWN Simple Variables
Note that this restriction applies only to OWN arrays, not to simple variables or pointers with an OWN clause. For exported procedures that declare such variables, it does not matter whether the client process or the server library process invokes the procedure first.
Timing Issues in Shared Libraries
If the library is a shared library, then synchronization issues arise for any OWN objects declared in an exported procedure. The OWN clause allows multiple client processes to access the same instance of the same object. For example, if two client processes are concurrently executing the same library procedure, and the library procedure declares an OWN object, then any changes made by one client process to the value of the object are immediately visible to the other client process. To prevent timing ambiguities, you can use techniques such as those discussed under Global Objects in Server Libraries later in this section.

