We’ve seen latching as a mechanism for protecting memory while we search through, and possibly modify, lists, but I’ve pointed out that we ought to avoid holding latches for any length of time. This means that if we need to do something time-consuming when we’ve found the bit of memory we were searching for, we need to devise a different mechanism to protect that memory while we’re using it so that we can release the latch. This is where library cache locking (and pinning) comes into play.
Before looking at library cache locks, though, we’ll turn our attention to the better known and more easily observable form of locking—the activity we see in
v$lock, which, broadly speaking, is a view over
x$ksqrs (the enqueue resources) joined to a union ...