- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: latch free
Operating System - HP-UX
1753479
Members
4952
Online
108794
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2003 02:52 AM
тАО04-15-2003 02:52 AM
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2003 03:05 AM
тАО04-15-2003 03:05 AM
Re: latch free
Hi
go to www.docs.hp.com and search on latch
Latches
A latch regulates access to a data structure in memory. Latches are generally held for a very short period of time. An example is a memory-to-memory copy of a data page. While the copy takes place, it is important that no other transaction is allowed to alter the content of the data structure. The most commonly latched objects in ALLBASE/SQL are buffer pages, though other data structures are also latched. ALLBASE/SQL latches both data and log pages. For the log buffer, latching is the only mechanism used to regulate concurrent access. Log records are not locked.
Like locks, latches are also represented in shared memory as control blocks, but these are not allocated following a user's request; instead, they are allocated when the DBEnvironment starts up. Latches are more efficient than locks, because deadlocks are not automatically detected in latching. Instead, deadlocks are avoided. Unlike locking, latching does not require the overhead necessary for deadlock detection.
Steve Steel
go to www.docs.hp.com and search on latch
Latches
A latch regulates access to a data structure in memory. Latches are generally held for a very short period of time. An example is a memory-to-memory copy of a data page. While the copy takes place, it is important that no other transaction is allowed to alter the content of the data structure. The most commonly latched objects in ALLBASE/SQL are buffer pages, though other data structures are also latched. ALLBASE/SQL latches both data and log pages. For the log buffer, latching is the only mechanism used to regulate concurrent access. Log records are not locked.
Like locks, latches are also represented in shared memory as control blocks, but these are not allocated following a user's request; instead, they are allocated when the DBEnvironment starts up. Latches are more efficient than locks, because deadlocks are not automatically detected in latching. Instead, deadlocks are avoided. Unlike locking, latching does not require the overhead necessary for deadlock detection.
Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2003 03:39 AM
тАО04-15-2003 03:39 AM
Re: latch free
hi,
Latches are lightweight serialization devices used to coordinate multi-user access to shared data structures, objects and files.
Latches are locks that are held for extremely short periods of time, for example the time it takes to modify an in-memory data structure. They are used to protect certain memory structures, such as database block buffer cache or the library cache in the shared pool. Latches are typically requested internally in a "willing to wait" mode. This means that if the latch is not available, the requesting session will sleep for a short period of the time and retry the operation later. Other latches may be requested in an "immediate" mode, meaning that the process will go do something else rather than sit and wait for the latch to become available. Since many requestors may be waiting for a latch at the same time, you may see some processes waiting longer than others. Latches are assigned rather randomly, based on the 'luck of draw', if you will. Whichever session asks for a latch right after it was released will get it. There is no line of latch waiters, just a 'ob' of waiters constantly retrying.
Oracle uses atomic instructions like 'test and set' for operating on latches. Since the instructions to set and free latches are atomic, the operating system itself guarantees that only one process gets it. Since it is only one instruction, it can be quite fast. Latches are held for short periods of time and provide a mechanism for clean-up in case a latch holder 'dies' abnormally while holding it. This cleaning up process would be performed by PMON.
Normally, hard parses require MANY MANY latches - on data structures in the shared pool. They get in each others way.
To summarise:
latches = locks, locks = serialization device, serialization devices = less scalable, slower.
Best regards
Yogeeraj
Latches are lightweight serialization devices used to coordinate multi-user access to shared data structures, objects and files.
Latches are locks that are held for extremely short periods of time, for example the time it takes to modify an in-memory data structure. They are used to protect certain memory structures, such as database block buffer cache or the library cache in the shared pool. Latches are typically requested internally in a "willing to wait" mode. This means that if the latch is not available, the requesting session will sleep for a short period of the time and retry the operation later. Other latches may be requested in an "immediate" mode, meaning that the process will go do something else rather than sit and wait for the latch to become available. Since many requestors may be waiting for a latch at the same time, you may see some processes waiting longer than others. Latches are assigned rather randomly, based on the 'luck of draw', if you will. Whichever session asks for a latch right after it was released will get it. There is no line of latch waiters, just a 'ob' of waiters constantly retrying.
Oracle uses atomic instructions like 'test and set' for operating on latches. Since the instructions to set and free latches are atomic, the operating system itself guarantees that only one process gets it. Since it is only one instruction, it can be quite fast. Latches are held for short periods of time and provide a mechanism for clean-up in case a latch holder 'dies' abnormally while holding it. This cleaning up process would be performed by PMON.
Normally, hard parses require MANY MANY latches - on data structures in the shared pool. They get in each others way.
To summarise:
latches = locks, locks = serialization device, serialization devices = less scalable, slower.
Best regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2003 10:48 PM
тАО04-15-2003 10:48 PM
Solution
What is a latch : -
____________________
Latches are low level serialization mechanisms used to protect shared data structures in the SGA (System Global Area). The implementation of latches is operating system dependent.
A latch is a type of a lock that can be very quickly acquired and freed. Latches are typically used to prevent more than one process from executing the same piece of code at a given time. Associated with each latch is a cleanup procedure that will be called if a process dies while holding the latch. Latches have an associated level that is used to prevent deadlocks. Once a process acquires a latch at a certain level it cannot subsequently acquire a latch at a level that is equal to or less than that level (unless it acquires it nowait).
When do we need to obtain a latch :-
_____________________________
A process acquires a latch when working with a structure in the SGA. It continues to hold the latch for the period of time it works with the structure. The latch is dropped when the
process is finished with the structure. Each latch protects a different set of data, identified by the name of the latch. Oracle uses atomic instructions like "test and set" for operating on latches. Processes waiting to execute a part of code for which a latch has
already been obtained by some other process will wait until the latch is released.
Examples are redo allocation latches, copy latches, archive control latch etc. The basic idea is to block concurrent access to shared data structures. Since the instructions to
set and free latches are atomic, the OS guarantees that only one process gets it. Since it is only one instruction, it is quite fast. Latches are held for short periods of time and provide a mechanism for cleanup in case a holder dies abnormally while holding it. This cleaning is done using the services of PMON
Refer to the attachment for further details and how can we reduce contention for internal latches
____________________
Latches are low level serialization mechanisms used to protect shared data structures in the SGA (System Global Area). The implementation of latches is operating system dependent.
A latch is a type of a lock that can be very quickly acquired and freed. Latches are typically used to prevent more than one process from executing the same piece of code at a given time. Associated with each latch is a cleanup procedure that will be called if a process dies while holding the latch. Latches have an associated level that is used to prevent deadlocks. Once a process acquires a latch at a certain level it cannot subsequently acquire a latch at a level that is equal to or less than that level (unless it acquires it nowait).
When do we need to obtain a latch :-
_____________________________
A process acquires a latch when working with a structure in the SGA. It continues to hold the latch for the period of time it works with the structure. The latch is dropped when the
process is finished with the structure. Each latch protects a different set of data, identified by the name of the latch. Oracle uses atomic instructions like "test and set" for operating on latches. Processes waiting to execute a part of code for which a latch has
already been obtained by some other process will wait until the latch is released.
Examples are redo allocation latches, copy latches, archive control latch etc. The basic idea is to block concurrent access to shared data structures. Since the instructions to
set and free latches are atomic, the OS guarantees that only one process gets it. Since it is only one instruction, it is quite fast. Latches are held for short periods of time and provide a mechanism for cleanup in case a holder dies abnormally while holding it. This cleaning is done using the services of PMON
Refer to the attachment for further details and how can we reduce contention for internal latches
Never give up, Keep Trying
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP