<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 13 mag 2021 alle ore 11:21 Juan Navarro <<a href="mailto:juan.navarro@gmx.es">juan.navarro@gmx.es</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, my email was pretty technical and long so maybe a shorter summary<br>
question could be helpful:<br>
<br>
is libnice supposed to emit all its signals exclusively from the same<br>
thread than the one of its GMainContext?<br>
<br></blockquote><div><br></div><div>Hi Juan,</div><div><br></div><div>of course I'm not the best to answer this, but just to share our experience, we found out that not all signals are sent from the main context thread, or at least not always. We discovered this when trying to figure out a crash that someone reported for Janus about a year ago:</div><div><br></div><div><a href="https://github.com/meetecho/janus-gateway/issues/2045">https://github.com/meetecho/janus-gateway/issues/2045</a></div><div><br></div><div>In our case, it was caused by the wrong assumption that the selected-pair callback would always be fired by the same thread as the other libnice events, which turned out not to be true:</div><div><br></div><div><a href="https://github.com/meetecho/janus-gateway/issues/2045#issuecomment-608505011">https://github.com/meetecho/janus-gateway/issues/2045#issuecomment-608505011</a></div><div><a href="https://github.com/meetecho/janus-gateway/issues/2045#issuecomment-608544762">https://github.com/meetecho/janus-gateway/issues/2045#issuecomment-608544762</a></div><div><br></div><div>As a consequence, we had to refactor the code a bit, so that some things we were doing in place would be performed as a result on messaging on the same loop libnice uses:</div><div><br></div><div><a href="https://github.com/meetecho/janus-gateway/pull/2048">https://github.com/meetecho/janus-gateway/pull/2048</a></div><div><br></div><div>Not sure if this helps you with your issue, but I hope the perspective from another developer helps clarifying your doubts a bit!<br><br></div><div>Cheers,</div><div>Lorenzo<br></div></div></div>