Rx 2:线程安全 [英] Rx 2: Thread Safe
问题描述
RX 2主题和操作符是否成为线程安全?
我正在寻找像Switch这样的运算符的反汇编,我注意到它们确实在实现中使用了锁。 / p>
public void OnNext(TSource值)
{
lock ( this ._ parent._gate)
{
if (( 长 )
this ._ parent._latest!=( long )
this ._ id)
返回 ;
此 ._ parent._observer.OnNext(value);
}
}
RX主题和运算符的哪一部分是线程安全的,哪些不是?
Bart你能给我们任何官方评论吗?
Bnaya Eshet
答案很长,所以我开始写一篇关于这个主题的博客文章。请继续关注!
Does RX 2 subjects and operator become thread safe?
I was looking on disassembly of operators like Switch and I have notice that they do use lock within the implementation.
public void OnNext(TSource value)
{
lock (this._parent._gate)
{
if ((long) this._parent._latest != (long) this._id)
return;
this._parent._observer.OnNext(value);
}
}
What part of RX subject and operators are thread-safe and which aren’t?
Bart can you give us any official comment?
Bnaya Eshet
The answer is quite lengthy, so I've started to write a blog post about this topic. Stay tuned!
这篇关于Rx 2:线程安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!