查看完整版本: [-- All functions in this class are reentrant.这句话什么意思 --]

QTCN开发网 -> 《C++ GUI Qt 4编程》(第2版)专栏 -> All functions in this class are reentrant.这句话什么意思 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

ingenious 2015-10-03 01:20

All functions in this class are reentrant.这句话什么意思

All functions in this class are reentrant.这句话什么意思

yanwuyue 2015-10-06 10:44
谷歌翻译:此类中的所有功能都是可重入

都是虚函数吧

kenierlee 2015-10-09 09:27
Throughout the documentation, the terms reentrant and thread-safe are used to mark classes and functions to indicate how they can be used in multithread applications:

A thread-safe function can be called simultaneously from multiple threads, even when the invocations use shared data, because all references to the shared data are serialized.
A reentrant function can also be called simultaneously from multiple threads, but only if each invocation uses its own data.
Hence, a thread-safe function is always reentrant, but a reentrant function is not always thread-safe.

By extension, a class is said to be reentrant if its member functions can be called safely from multiple threads, as long as each thread uses a different instance of the class. The class is thread-safe if its member functions can be called safely from multiple threads, even if all the threads use the same instance of the class.

Note: Qt classes are only documented as thread-safe if they are intended to be used by multiple threads. If a function is not marked as thread-safe or reentrant, it should not be used from different threads. If a class is not marked as thread-safe or reentrant then a specific instance of that class should not be accessed from different threads.


查看完整版本: [-- All functions in this class are reentrant.这句话什么意思 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled