事件处理程序是否异步处理? [英] Are Event Handlers processed Asynchronously?

查看:119
本文介绍了事件处理程序是否异步处理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB .NET中,当调用RaiseEvent X()时,是处理异步处理或同步处理的事件X的函数。我的印象是RaiseEvent和事件的处理是同步的,除非在另一个线程上明确地创建。除非另有说明,否则我会被告知。

In VB .NET, when you call RaiseEvent X(), is the function that handles the event X processed asynchronously or synchronously. I was under the impression that RaiseEvent and the processing of the event were Synchronous unless created explictly on another thread. I've been told otherwise though.

推荐答案

由于 MulticastDelegates 被设计为支持异步调用,可以异步调用事件的调用列表中的委托,但这不是默认行为。

Events are raised synchronously by default. Since MulticastDelegates are designed to support asynchronous invocation it is possible to invoke the delegates in an event's invocation list asynchronously but this is not the default behavior.

这篇关于事件处理程序是否异步处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆