在不朽内存中创建审计线程对象,在堆中运行。
Create the auditing thread object in immortal, running in the heap.
可以用这个对象访问每个线程的信息。
You can use this object to access information about each thread.
当等待单一线程同步对象时,可以使用此方法。
You can use this method when waiting on a single thread synchronization object.
但也有一个特殊的控制线程是通过系统中的多个对象进行工作的。
A particular thread of control works its way through multiple objects in the system.
执行wait和notify的线程当前必须已经锁定对象。
Threads doing wait and notify must currently have locked the object.
利用Future对象,当前线程可阻塞来等待结果
Using the Future object, the current thread can block to wait for the result
一旦 pthread_cond_wait()锁定了互斥对象,那么它将返回并允许1 号线程继续执行。
Once pthread_cond_wait() has the lock, it will then return and allow thread 1 to continue execution.
假设一个应用程序由两个线程组成,而这两个线程都尝试访问同一个对象。
Imagine an application that consists of two threads, both trying to access the same object.
两个线程不能同时对同一个互斥对象加锁。
No two threads can have the same mutex locked at the same time.
当Work对象发送到另一个线程时将调用run()方法。
The run() method is called when the Work object is dispatched to another thread.
重置指定线程状态对象的所有信息。解释器锁必须捕获。
Reset all information in a thread state object. The interpreter lock must be held.
现在除了线程内核对象外。
重置指定线程状态对象的所有信息。解释器锁必须捕获。 捕获状态解释。
Reset all information in a thread state object. The interpreter lock must be held.
创建一个从属于给定解释器的新线程状态对象。
Create a new thread state object belonging to the given interpreter object.
同严格实现的锁一样,一个线程一次只能拥有一个锁对象。
As with implicit locks, only one thread can own a lock object at a time.
实现的方式与构造线程本地对象一样。
This is accomplished just like the construction of thread local objects.
第一个问题是,不同的线程在同一时间访问对象…
The first problem is the fact that different threads access objects at the same time…
目前所有的COM对象只能写成支持单线程的公寓模型。
Currently all the COM objects are only written to support the single threaded apartment model.
首先最重要的是你的COM对象的线程模型。
The important thing to start with is the threading model of your COM object.
仅当所有线程在访问该集合前都锁定该对象时,同步才有效。
Synchronization is effective only if all threads lock this object before accessing the collection.
对象的静态实例不是线程安全的。
线程尝试获取对具有弱标识的对象的锁。
A thread attempts to acquire a lock on an object that has a weak identity.
锁定对象或域,而不是去保证决定性和线程安全访问。
Lock your object or fields instead to guarantee deterministic and thread-safe access.
可选择:让对象线程安全是个好主意。
可选择:让对象线程安全是个好主意。
应用推荐