From: Phillip Helbig [HELBPHI@sysdev.deutsche-boerse.com] Sent: Wednesday, April 02, 2003 10:10 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: New SPAWN behavior with V7.3-1 > Instead of creating process name sequentially, i.e SYSTEM_1, SYSTEM_2, > we now generate a random number between 0-255. So your first spawned > process might be called SYSTEM_57. In case anyone doesn't have a 7.3-1 system, below is the exemplary HELP on this topic. First, there is a typo: "one is found that unique" should be "one is found that is unique". Wouldn't the following mechanism be even more efficient? When a new subprocess is created, define DCL$SUBPROCESS_NUMBER or whatever in the group table to be that number. Before a process is created, it will translate this logical name and increment it by 1. (One should still try again if the process already exists in case two processes were simultaneously creating subprocesses, someone created processes with the corresponding names by hand etc, but this would happen only occasionally and the trial-and-error stuff would only kick in when such a subprocess actually already existed.) I'm not an internals guy, but it seems to me that one define and one translation of a logical name with each creation would be negligible compared with the full subprocess creation, and especially compared to a tried and failed creation, which will still happen occasionally even with the new system (unless the random numbers aren't truly random, but rather the sequence (preferably of the full length of 255) runs once before repeating (perhaps in the same order). ---------8<------------------------------------------------------------------- SYS_PARAMETERS DCL_CTLFLAGS DCL_CTLFLAGS is a bitmask used to alter default behavior for certain commands on a systemwide basis. At present, only the low bit of the bitmask is defined. The low bit controls the default process-name assignment for a subprocess created using the SPAWN command or LIB$SPAWN routine. Prior to OpenVMS Version 7.3-1, if no process name was supplied, the system constructed a name by appending _n to the username, where n was the next available non-duplicate integer for any process currently in the system. For example, the first spawned process from user SYSTEM would be called SYSTEM_1, the second, SYSTEM_2, and so on. The next available number was chosen, as soon as a gap was found. A problem with this technique is that determining the next available number is very expensive in terms of performance, because the mechanism attempts to create the process by incrementing names until one is found that unique. When several subprocesses already exist, the cost of creating the subprocess iteratively becomes even more expensive. When many processes are in the same OpenVMS group, the cost multiplies because process names must be unique throughout the group. Beginning in OpenVMS Version 7.3-1, the default constructed process name for subprocesses has changed. Instead of incrementally searching for the next unique number, a random number is chosen to append to the username. Therefore, the first processes that are spawned from user SYSTEM might be SYSTEM_ 154, SYSTEM_42, SYSTEM_87, and so on. This procedure results in a very high probability of finding a unique name on the first try, because it is unlikely that the same number is already in use. This greatly reduces the cost of process creation, and applications that rely on spawned subprocesses might see a dramatic performance improvement due to this change. However, some applications might rely on the previous method of assigning subprocess names. The DCL_CTLFLAGS parameter is available to allow you to configure the system as necessary. Bit 0 of DCL_CTLFLAGS selects the behavior for assigning default subprocess names: o If the bit is clear, the new behavior is used. If you do not specify a process name, the system assigns the username with a random number suffix. This is the default setting. o If the bit is set, the prior behavior is used. If you do not specify a process name, the system assigns the username with a random number suffix.