本例中的这个代码更改没有涉及任何同步,因此也没有产生应用程序的锁定行为问题。
The code change in this example did not involve any synchronization and so there are no issues with the locking behavior of the application.
另一个例子是优先级继承,它是一种锁定策略,定义了锁竞争时如何管理锁同步。
Another example is priority inheritance, a locking policy that defines how lock synchronization is managed when a lock is contested.
清单1显示了如何使用锁定(同步)实现该类的例子。
Listing 1 shows an example of how this class might be implemented using locks (synchronization).
同步的方法和代码块允许线程在入口处锁定对象并在出口处解锁(针对方法或代码块)。
Synchronized methods and blocks allow a thread to lock an object on entry and unlock the object on exit (to the method or block).
如果同步时还发生锁定争用,那么性能上付出的代价会大得多,因为会需要几个线程切换和系统调用。
If the synchronization actually requires contending for the lock, the performance penalty is substantially greater, as there will be several thread switches and system calls required.
所以如果双重检查锁定的目标是提供比更直观的同步方式更好的性能,那么这个“修复的”版本也没有多大帮助。
So if the goal of double-checked locking is supposed to offer improved performance over a more straightforward synchronized approach, this "fixed" version doesn't help very much either.
因此不需要实现复杂的锁定及同步算法。
Thus, there is no need to implement complicated locking and synchronization algorithms.
POSIX通过 pthread_mutex数据类型提供锁定和同步支持。
POSIX provides locking and synchronization support through the pthread_mutex data type.
本文讨论了Linux内核中可用的大量同步或锁定机制。
This article explores many of the synchronization or locking mechanisms that are available in the Linux kernel.
同步的松散耦合WebServices并不会等待响应,而会锁定程序直到得到响应为止。
Synchronous loosely coupled Web services can't wait for an answer, locking up the program until the response comes back.
同步调用可以通过编程来实现,但带有超时设置,如果调用在一定的时间内未返回,调用WebServices可能取消锁定,从而从系统退出。
Synchronous calls can be programmed, but with timeouts so that if the call can't come back in a certain time, the calling Web service can be unlocked to exit from the system.
同步模式会在等待快速响应的同时锁定WebServices应用程序。
The synchronous mode locks up the Web service application while waiting for a quick response.
IndexWriter创建一个目录锁定文件,以通过同步索引更新保护索引不受破坏。
IndexWriter creates a lock file for the directory to prevent index corruption by simultaneous index updates.
Persevere使用延续(continuation)来挂起和继续执行,以便能够发起异步请求从服务器检索数据(这样一来,浏览器就不会由于同步请求而锁定)。
Persevere USES continuations to suspend and resume execution so that asynchronous requests are made to retrieve data from the server (so the browser doesn't lock up because of synchronous requests).
在两台机器上同步执行带有- w选项的amqmfschk,检测等待同时释放对目录的锁定。
Execute amqmfschk with the -w option on both the machines simultaneously to test waiting for and releasing a lock on the directory concurrently.
如果已知锁定是无争用的但是难以避免或删除同步指令,则对这些锁定花费一点小的确定的开销不失为明智的做法。
It can be desirable to have a small and deterministic cost for locking that is known to be uncontested but where synchronization directives are hard to avoid or remove.
其结果是:处理数据库锁定与同步的方案非常复杂,若不考虑数据库锁定与同步问题又会失去数据的完整性。
This often results in highly complex schemes to deal with database locking and concurrency, or alternatively, loss of data integrity when these issues are not considered.
创建一个新解释器状态对象。不必要捕获解释器锁,但是当需要同步调用这个函数进行序列化的时候可能需要锁定。
Create a new interpreter state object. The interpreter lock need not be held, but may be held if it is necessary to serialize calls to this function.
由于视频源并未同步锁定,因此无法从一路输入视频无缝切换到另一路视频。
As the video sources are not genlocked, it is not possible to switch seamlessly from one input video to another.
只需按下接收器上的同步按钮,用户可以自动锁定50至发射器和接收器可超高频频率。
By simply pressing the Sync button on the receiver, the user can automatically lock any of 50 available UHF frequencies between the transmitter and receiver.
每个对象都有一些附加字节,通用语言运行库用来管理对象,如对象的虚表指针和同步锁定引用。
Every object has some additional bytes that the common language runtime USES to manage the object, such as the object's virtual table pointer and a reference to a sync block.
采用滑动相关捕获和延迟锁定环实现伪码的同步、捕获和跟踪;
Slip correlative taking and delay locked loop are used for the synchronization, taking, locking of PN code.
一个原始的锁(锁)是一个同步原语是不属于一个特定的线程锁定时。
A primitive lock (lock) is a synchronization primitive that is not owned by a particular thread when locked.
经实践验证,该系统实现了自动控制接收天线转向并锁定某一个同步通信卫星,以获得最佳的通信信号。
It is proved that this system automatically steers the direction of a receiver antenna and locks a synchronous satellite in order to acquire best communication signal.
仅当所有线程在访问该集合前都锁定该对象时,同步才有效。
Synchronization is effective only if all threads lock this object before accessing the collection.
系统做混沌运动,测度同步时系统的相位移是随机行走的,没有测度同步点与相锁定点的重合。
When the coupled systems are chaotic, that is, the largest Lyapunov exponent is positive, the measure synchronization does not go with the phase synchronization, the phase locking changes random walk.
唯有在存取集合之前,将所有执行绪都锁定物件,同步处理才会有效。
Synchronization is effective only if all threads lock the object before accessing the collection.
当执行绪结束程式码的同步化区块时,锁定会被释放,不管执行绪如何结束该区块。
When the thread exits the synchronized block of code, the lock is released, no matter how the thread exits the block.
不必要捕获解释器锁,但是当需要同步调用这个函数进行序列化 的时候可能需要锁定。
The interpreter lock need not be held, but may be held if it is necessary to serialize calls to this function.
不必要捕获解释器锁,但是当需要同步调用这个函数进行序列化 的时候可能需要锁定。
The interpreter lock need not be held, but may be held if it is necessary to serialize calls to this function.
应用推荐