Show any hacker a lock and his first thought is how to pick it.
任何黑客看到一把锁,首先想到的是怎么才能撬开。
A slow lock is owned by another thread and must be relinquished by that other thread before it can be acquired.
慢锁由另一个线程持有,在可以被请求之前必须被那另一个线程释放掉。
What is ideally needed is the ability to lock a resource, verify its availability, and unlock it if no longer available.
理想的方式是能锁定资源、确认其可用性并在不再使用时解除其锁定。
Through the use of UXs, it is now possible to lock columns in a grid as well as group grid columns.
通过使用UX,可以将网格中的列锁定,以及将网格列合并成组。
Even better, in recent JVMs, the performance cost of uncontended synchronization (when no thread attempts to acquire a lock when another thread already holds it) is quite modest.
不过现在好了一点,在最近的JVM 中,没有争用的同步(一个线程拥有锁的时候,没有其他线程企图获得锁)的性能成本还是很低的。
This function gets a pointer to the mutex it is trying to lock.
这个函数会获得一个指向它正在尝试锁定的互斥的指针。
What you generally see is that people lock onto a version of this application, and then just refuse to upgrade when it starts getting out of control.
你通常看到的一个现象就是:人们固定地使用软件的某一个版本,然后当该软件失去控制时他们却拒绝将其更新。
Lock contention occurs when a lock is currently in use and another thread tries to acquire it.
当一个锁当前正在使用,而另一个线程试图获取它,那么就会出现锁争用。
In fact, when this feature is enabled, and the INSERT operation requires a new or reused block, DB2 will take an exclusive (x) lock on the block in order to add it to the target cell.
实际上,当该特性被启用,并且INSERT操作要求一个新的或重用的块时,DB 2将在块上采用一个独占的(X)锁,以便将它添加到目标单元。
This approach has some obvious drawbacks, including the fact that while a thread is blocked waiting for a lock, it cannot do anything else.
此方法具有一些明显的缺点,其中包括当线程被阻塞来等待锁定时,它无法进行其他任何操作。
As such, finding a spot to lock it up on London's busy streets is a cinch - you simply wrap it around the nearest lamppost.
如此,想要在伦敦街头找到一个锁定它的地方简直是轻而易举——仅仅需要把它环绕在最近的电杆就行了。
While spin locks are CPU-intensive and appear inefficient, they can be more efficient than suspending the thread and subsequently waking it up if the lock in question is held for a very short time.
虽然旋转锁是cpu密集型的,显得效率低下,但是如果争夺的锁被持有的时间非常短,那么旋转锁要比暂挂线程然后再唤醒它更有效率。
It is only when we look at the lock in the context of a runtime environment can we finally answer the question, did we really need the lock?
“我们真的需要锁么?”这个问题只有在我们将锁放在运行时环境的上下文中观察之后,才能最终给出答案。
Lock contention occurs when a lock is currently in use and another thread attempts to acquire it by another thread.
如果一个锁正在使用中,而另一个线程尝试获取它,这时会发生锁争用。
"The sea level rise is a much slower thing, so it will take a long time to happen, but we will lock into it, based on the peak level of [carbon dioxide] we reach in this century," Solomon says.
“海平面上升是一个缓慢得多的事情,因此将需要很长时间才能发生,但我们将基于本世纪达到的二氧化碳峰值锁定它的水平。”所罗门说。
It is a commonly held belief that you do not need to acquire a lock to simply read an object's fields, especially since the JLS guarantees that 32-bit reads will be atomic.
有一种普遍的观点是,如果只是要读一个对象的字段,不需要请求加锁,尤其是在JLS保证了32位读操作的原子性的情况下,它更是如此。
A new object is allocated from the end of this cache without the need to grab the heap lock, so it is very efficient.
新对象是从这个高速缓存的末端分配的,而不必获取堆锁,因此效率非常高。
It is also incorrect for classes to express the desire to have their operations managed with a lock, as the classes selected will depend on the application's usage of those classes.
也不应该让类指出它们的操作是否要用锁管理,因为所选择的类将取决于应用程序对这些类的使用。
A soft lock is just a special cache value invalidation representation that stops other transactions from reading or writing to the cache before it gets the new database value.
软锁只是一种特定的缓存值失效表述方式,在它获得新数据库值前阻止其他事务读写缓存。
That is, it would be more efficient to allow readers to run while other readers held the lock, but you'd risk a constant stream of reader threads keeping the writer from ever doing its job.
即,允许一些读取器在其他读取器锁定时运行效率更高,但是您可能会有读取器线程的流持续不断的风险,导致编写器无法进行工作。
Pledges on Europe need treating with caution, but if you wanted a real referendum lock, this is what it would look like.
对欧盟的承诺需要谨慎对待,但是要想建立一个真正意义上的公投机制,就得这样。
The shorter the time a thread holds a given lock, the lower the probability that another thread will request it while the first thread is holding it.
一个线程占用一个给定锁的时间越短,另一个线程在该线程仍占用锁时请求该锁的可能性就越小。
It seems that this is a company that has kept its options open from the start with sensible it decisions that have avoided the dreaded lock-in.
看来,这家公司一开始就做了一个明智的决定,避免了可怕的锁定,从而给自己留有回旋的余地。
It holds a lock on the queue manager data to ensure that there is only one active instance of the queue manager.
它可以锁定队列管理器数据,确保队列管理器中只有一个活动实例。
If a lock is acquired recursively, the requesting thread already owns it.
如果锁是以递归方式被请求,那么发出请求的线程已经持有了它。
It wasn't noticed much because the Bulls are so good defensively as a unit, but Deng is a lock-down defender.
这并不为人所知,仅仅是因为公牛的出色的整体防守,但是鲁尔邓能够出色地完成单防任务。
To ITS opponents, it is a brazen attempt by a crafty monopolist to lock up some of the world's most valuable intellectual property.
在竞争对手看来,谷歌如同一只精于垄断的老狐狸,厚颜无耻到竟然想把世界最宝贵的知识财富锁进自家柜里。
Even when run with a single thread, the collapsed version was some 30 percent faster: it is much faster to acquire a lock that you already hold than one that nobody holds.
即使只运行一个线程,崩溃版的速度也要快约30%:获取您已占用的锁比获取无人占用的锁要快得多。
If a process is hanging around that is holding onto the file, it will prevent the virtual machine from being able to get the lock on the file.
如果跟文件有关的一个进程挂起了,那么这就会使虚拟机不能对该文件加锁。
Likewise, if thread "c" tries to lock the mutex while thread "a" is holding it, thread "c" will also be put to sleep temporarily.
同样地,当线程a正锁定互斥对象时,如果线程c试图锁定互斥对象的话,线程c也将临时进入睡眠状态。
应用推荐