you're probably right but I wonder what you are doing that is binding and unbinding so much?<div>The bind and unbind was designed to be called once when the module is loaded and called again when it exits.</div><div><br>
</div><div>My fear is you are using the embedded scripting event handers in some quick repeating fashion.</div><div><br></div><div>I did a commit to flip that case around but I don't encourage you to use embedded scripts for heavy event traffic, that's what event socket is for and if you have the C skills to debug this, you might want to try a C app ;)</div>
<div><br><br><div class="gmail_quote">2011/11/28 Brian West <span dir="ltr"><<a href="mailto:brian@freeswitch.org">brian@freeswitch.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">Please post it to <a href="http://jira.freeswitch.org" target="_blank">jira.freeswitch.org</a><div><br></div><font color="#888888"><div>/b</div></font><div class="im"><div><br><div><div>On Nov 28, 2011, at 2:31 AM, Karol Golab wrote:</div>
<br><blockquote type="cite"><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium"><br>
Hi!<br><br> I've noticed some strange code in src/switch_event.c - could someone<span> </span><br>smarter (& knowing the mentioned code) please take a look?<br><br> The problem is in the order of calls to locks BLOCK & RWLOCK - it<span> </span><br>
differs between functions:<br><br>switch_event_bind_removable<br> switch_mutex_lock(BLOCK);<br> switch_thread_rwlock_wrlock(RWLOCK);<br><br>switch_event_unbind_callback<br> switch_thread_rwlock_wrlock(RWLOCK);<br>
switch_mutex_lock(BLOCK);<br><br>switch_event_unbind<br> switch_thread_rwlock_wrlock(RWLOCK);<br> switch_mutex_lock(BLOCK);<br><br> As I understand this may lead to an outright deadlock between bind<span> </span><br>
and unbind.<br><br> I stumbled upon this code while debugging what seems like deadlocks<span> </span><br>in our test FS installation put under some heavy load. The load is about<span> </span><br>25 new event subscribers per second (destroyed few seconds later) and<span> </span><br>
about 700 events per second.<br><br> Regards,<br> Karol<br></span></blockquote></div><br></div></div></div><br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:+19193869900<br>
</div>