A method and computer system for dynamically selecting an optimal lock mode in a multiprocessor environment. The method determines a quantity of read-side and write-side acquisitions, and evaluates the data to determine an optimal lock mode for efficiently operating the computer system while maintaining reduced overhead. The method incorporates data received from the individual units within a central processing system, the quantity of write-side acquisitions in the system, and data which has been subject to secondary measures, such as formatives of digital filters. The data subject to secondary measures includes, but is not limited to, a quantity of read-side acquisitions, a quantity of write-side acquisitions, and a quantity of read-hold durations. Based upon the individual unit data and the system-wide data, including the secondary measures, the operating system may select the most efficient mode of operation from among the locking modes available. Accordingly, efficiency of a computer system may be enhanced with the ability to selectively choose an optimal locking mode based upon selected and calculated parameters.
CROSS REFERENCE TO RELATED APPLICATION(S)
The present application is a continuation of U.S. patent application Ser. No. 09/741,679 filed Dec. 19, 2000, now U.S. Pat. No. 6,678,772.
The systems and methods described herein are directed at controlling access to a data structure. A data field is included within the data structure. The data field includes information about the accessibility of the data structure. In response to an attempt to access the data structure by a first thread, the data field is configured to identify that the data structure is not accessible by another thread. The first thread can then access the data structure. In response to an attempt to access the data structure by a second thread, the second thread is configured to determine from the data field that the data structure is being accessed by the first thread.
A method and computer system for dynamically selecting an optimal synchronization mechanism for a data structure in a multiprocessor environment. The method determines a quantity of read-side and write-side acquisitions, and evaluates the data to determine an optimal mode for efficiently operating the computer system while maintaining reduced overhead. The method incorporates data received from the individual units within a central processing system, the quantity of write-side acquisitions in the system, and data which has been subject to secondary measures, such as formatives of digital filters. The data subject to secondary measures includes, but is not limited to, a quantity of read-side acquisitions, a quantity of write-side acquisitions, and a quantity of read-hold durations. Based upon the individual unit data and the system-wide data, including the secondary measures, the operating system may select the most efficient synchronization mechanism from among the mechanisms available. Accordingly, efficiency of a computer system may be enhanced with the ability to selectively choose an optimal synchronization mechanism based upon selected and calculated parameters.