开发者

Can CancellationTokens be used across AppDomains

.NET 4 introduced some types to nicely support cooperative cancellation. I would like to be able to cancel an operation wh开发者_如何学JAVAich is running in a different AppDomain. The CancellationToken type is a struct. If I pass it to another AppDomain, will it work as normal?


I'm not familiar with .NET 4 or cancellation tokens, but the cancellation struct doesn't appear to have the SerializableAttribute so you probably won't be able to get it across the AppDomain boundry in the first place.

You might be able to create a MarshalByRefObject wrapper to do this for you though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜