且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么不推荐使用本机Visual C ++中的事件处理?

更新时间:2023-11-08 20:21:04


  1. 这完全是非标准的实际的
    用户可能很少。我的意思是即使在WinNT和Microsoft私有世界中,非标准狂人也喜欢。

  1. It's totally non-standard kludge that probably has very little actual users. And I mean non-stndard kludge even in WinNT and Microsoft-private world.

COM对于类似事件的机制具有更丰富的功能,并且还允许$ b $如今,b完全是多线程的代码

COM has much richer repertoire for event-like mechanisms and also allow fully multi-threaded code these days

这是致命的-该功能正在进行隐式锁定(可能是我们爷爷的想法 bsynchonized模板之前,并广泛安全地使用正常关键部分)。
使其比COM的单身公寓更加危险:等等,因为它可能给您带来死锁(也发生在Java的同步方法上-没什么特别的:-)

This one is lethal - that functionality is doing implicit locking (probably our grandpa's idea of "synchonized" before templates and widespread safe use of normal critical sections). That makes it more dangerous than COM's single apartment, ahem, thing :-) As in it can give you a deadlock out of nowhere (happened to Java's synchronized methods as well - nothing special :-)

这些天,每个人和他们的狗都知道如何使用普通的多线程以及至少具有智能指针的关键部分,因此,除了危险之外,这也无关紧要。

Everyone and their dogs know how to use normal multi-threading and at least critical sections with smart pointers these days, so besides being dangerous, that thing is also irrelevant.