Step 2: Create your Comment and Thread classes.
第2步:创建您的评论类和线索类。
This depends on your ability to recognize the methods and classes in question, not to recognize the thread itself, per se.
从本质上讲,这取决于您识别有问题的方法和类的能力,而不是识别线程本身。
You should also remember that static classes that preserve state between method calls should be made thread safe by default.
您还应该记得,在方法调用之间保留状态的静态类在默认情况下应该是线程安全的。
First, it initializes those system classes that don't require thread support by executing their static initializers.
首先,它初始化这些系统类不需要线程支持来执行这些静态的初始化。
Only a single thread is used for all these benchmarks; the synchronized classes are under no thread contention.
所有基准测试都只使用一个线程;同步的类不涉及线程争用。
One advantage of immutable classes is that they are thread-safe.
(不可变类的一个优点就是它们是线程安全的)。
It is often the easiest way to render a stateful class thread-safe, or to encapsulate non-thread-safe classes so that they can safely be used in multithreaded environments.
它常常是把有状态类描绘成线程安全的,或者封装非线程安全类以使它们能够在多线程环境中安全地使用的最容易的方式。
These classes guarantee that an RT thread, which could be blocked by GC while performing a wait-free operation, won't hold a lock that an NHRT requires in performing a wait-free operation.
RT线程在执行无等待操作时可能被GC阻塞,上述类保证了 RT 线程在执行无等待操作时不会持有NHRT 所需的锁。
If you find yourself in need of a thread pool for your application, consider using one of the Executor classes from util.concurrent, such as PooledExecutor, rather than writing one from scratch.
如果您发现您的应用程序需要线程池,那么请考虑使用ut il . concurrent中的某个executor类,例如PooledExecutor,而不用从头开始编写。
The run method on this class is final so that derived classes cannot use it to specify their logic. Instead, you should override the following method so that it contains the logic for the thread.
此类的run方法是final类型,因此派生类不能使用它指定自己的逻辑。
Some classes retain state information from one method invocation to the next, and it is difficult to make such classes thread-safe in any practical way.
有些类保留从一个方法调用到下一个方法调用的状态信息,要在实践中使这样的类成为线程安全的是困难的。
Do you need to single-thread your classes or can you allow WCF to spin up multiple instances simultaneously?
你是否需要让你的类是单线程的?或者允许WCF能够在同一时间有多个实例?
The atomic classes guarantee that certain operations will be performed in a thread-safe manner, such as incrementing and decrementing a value, updating a value, and adding a value.
原子类确保某些操作以线程安全方式被执行,比如递增和递减一个值,更新一个值,添加一个值。
This topic explains the classes available and how to use them to create thread-safe classes in a typical multithreaded application.
本主题说明了可用的类以及如何在典型的多线程应用程序中使用它们创建线程安全类。
All the OLE DB provider classes are thread-safe, and registry entries are set accordingly.
所有oleDB提供程序类都是线程安全的,并且相应地设置注册表项。
With the exception of enumerators, all regular expression classes are thread safe or can be converted into thread-safe objects by a synchronized method.
除枚举数之外,所有正则表达式类都是线程安全的或者可以通过同步方法转换成线程安全对象。
The structures use MFC classes that are thread-safe already for threads accessing different objects.
数据库结构使用了MFC的类,这些类是线程安全设计的,能够让访问不同对象时不出问题。
MFC provides a number of classes that allow threads to synchronize access to objects to maintain thread safety.
MFC提供许多类别,这些类别允许执行绪同步物件的存取,以维护执行绪安全性。
MFC provides a number of classes that allow threads to synchronize access to objects to maintain thread safety.
MFC提供许多类别,这些类别允许执行绪同步物件的存取,以维护执行绪安全性。
应用推荐