Specifying the number of latches in a latch set

The number of latches that you include in each latch set depends on the number of latches that your application requires and the number of latch sets you decide to create. For example, if you estimate that your application will require 100 latches, you could create a single latch set that contains all the required latches, two latch sets that contain 50 latches each, and so on. You should create your latch sets and assign latches to resources so as to minimize contention for those resources.

If you find that your application requires more latches after you have created one or more latch sets, you must create an additional latch set to add the latches; you cannot add latches to an existing latch set.

If you need to associate latches with an extremely large number of resources, you can create a large latch set and use a hashing routine to associate the resources with latches. You may want to use this method if you have resources that can dynamically change, such as data sets, programs, or address spaces.

The amount of storage consumed by a latch set in the latch set creator's address space varies depending on the z/OS® release level, the highest number of concurrent outstanding latch obtains, and the latch set create options. The following values are approximate for z/OS V1R9 and for planning purposes only:
  • Each latch set is 128 bytes plus 32 bytes per latch and 110 bytes per outstanding latch obtain request. Additional working storage is used to enhance performance when the system uses the default latch set create option (that is, when the ISGLCRT_LOWSTGUSAGE create option is not specified). The amount of additional working storage used by each latch set varies with the number of configured processors.
  • If the ISGLCRT_LOWSTGUSAGE create option is used instead of the default option, less working storage is consumed at the expense of performance. Consider using the ISGLCRT_LOWSTGUSAGE option and fewer latches when the latch set creator's address space is constrained by private storage.