LotusScript agent thread safety

The relevant documentation seems to explain that when asynchronous agents are enabled global variables are not thread safe. Is this true? If I have two agents each of which declare a global object of the same name and they run simultaneously am I risking any interference? What about if it is multiple instances of the same agent? At what point do I have to worry about stomping on another agent’s globals?

Josh

LotusScript is thread safe; multiple LotusScript Web agents can run concurrently within the Domino server.

A thread is an instance of LotusScript, in this case an agent. All threads execute in the same memory space. LotusScript threads have no protection against updates on global variables or contention on the various internal data structures. By running multiple agents, you synchronize instances of LotusScript running against each other.

LotusScript agents run as separate threads in the same HTTP process. A process is a collection of one or more threads executing a single application.

Subject: Don’t worry!

Variables declared as global in the (Declarations) section of a LotusScript agent are in fact local to the agent, and thus not shared between multiple instances of the agent (or other agents with an identically named variable).

So you should be safe.

What you should avoid, is using truly global variables/settings such as files, profile documents and environment variables.