求两段 E 文翻译 关于COINIT 的

unhappyless 2009-10-20 11:26:13
Apartment-threading, while allowing for multiple threads of execution, serializes all incoming calls by requiring that calls to methods of objects created by this thread always run on the same thread – the apartment/thread that created them. In addition, calls can arrive only at message-queue boundaries (i.e., only during a PeekMessage, SendMessage, DispatchMessage, etc.). Because of this serialization, it is not typically necessary to write concurrency control into the code for the object, other than to avoid calls to PeekMessage and SendMessage during processing that must not be interrupted by other method invocations or calls to other objects in the same apartment/thread.

Multi-threading (also called free-threading) allows calls to methods of objects created by this thread to be run on any thread. There is no serialization of calls – many calls may occur to the same method or to the same object or simultaneously. Multi-threaded object concurrency offers the highest performance and takes the best advantage of multi-processor hardware for cross-thread, cross-process, and cross-machine calling, since calls to objects are not serialized in any way. This means, however, that the code for objects must enforce its own concurrency model, typically through the use of Win32 synchronization primitives, such as critical sections, semaphores, or mutexes. In addition, because the object doesn't control the lifetime of the threads that are accessing it, no thread-specific state may be stored in the object (in Thread-Local-Storage).
...全文
98 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
liliangbao 2009-10-20
  • 打赏
  • 举报
回复
帮顶~
unhappyless 2009-10-20
  • 打赏
  • 举报
回复
有没有人工翻译的
mnchyhzzhh 2009-10-20
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 garfield 的回复:]
公寓线程,而执行多线程允许,序列化的要求,要由该线程创建的对象方法的调用总是运行在同一线程-公寓/线程创建它们的所有来电。此外,通话可到达只有在消息只在一PeekMessage,SendMessage消息,DispatchMessage等队列边界(即)。由于这个序列化,它不是通常需要写入对象的代码,比以避免在处理过程中,绝不能由其他方法调用或在同一公寓的其他对象的调用中断调用SendMessage消息PeekMessage和其他并发控制/线程。

多线程(也称为自由线程)允许对本线程创建的对象的方法要求在任何线程上运行。没有调用序列化-许多人呼吁,可能会出现同样的方法或同一个对象或同时发生。多线程并发对象提供最高的性能,并采取了最有利的多处理器硬件跨线,跨进程,跨计算机致电的话,因为通话的对象不以任何方式序列化。这意味着,但是,该代码的对象必须执行通常是通过Win32的同步原语,如关键部分,信号量,或互斥,使用自己的并发模型。此外,由于该对象不控制线程正在访问它,没有线程特定的状态寿命可能会在对象(在线程局部-存储存储)。
[/Quote]

翻译工具翻译的把
bobo_2003 2009-10-20
  • 打赏
  • 举报
回复
挺长的,楼上帮了,帮UP
Garfield 2009-10-20
  • 打赏
  • 举报
回复
公寓线程,而执行多线程允许,序列化的要求,要由该线程创建的对象方法的调用总是运行在同一线程-公寓/线程创建它们的所有来电。此外,通话可到达只有在消息只在一PeekMessage,SendMessage消息,DispatchMessage等队列边界(即)。由于这个序列化,它不是通常需要写入对象的代码,比以避免在处理过程中,绝不能由其他方法调用或在同一公寓的其他对象的调用中断调用SendMessage消息PeekMessage和其他并发控制/线程。

多线程(也称为自由线程)允许对本线程创建的对象的方法要求在任何线程上运行。没有调用序列化-许多人呼吁,可能会出现同样的方法或同一个对象或同时发生。多线程并发对象提供最高的性能,并采取了最有利的多处理器硬件跨线,跨进程,跨计算机致电的话,因为通话的对象不以任何方式序列化。这意味着,但是,该代码的对象必须执行通常是通过Win32的同步原语,如关键部分,信号量,或互斥,使用自己的并发模型。此外,由于该对象不控制线程正在访问它,没有线程特定的状态寿命可能会在对象(在线程局部-存储存储)。
csgdseed 2009-10-20
  • 打赏
  • 举报
回复
翻译机的再改改

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧