<br><font size=2 face="sans-serif">Hi Mark,</font>
<br>
<br><font size=2 face="sans-serif">Thanks for your response.</font>
<br>
<br><font size=2 face="sans-serif">I do not think we will be moving to
ver 1.8.0 version of Asterisk since the Asterisk 1.4.22 code has been customised
to suit our platform. Also, this huge a change might not be welcomed this
late into our project. But since we are looking for some performance improvement
in Asterisk, we might consider the hash table look-up for the channels.
</font>
<br>
<br><font size=2 face="sans-serif">At the same time, moving to reference
counted objects for Asterisk channels might be a bigger risk compared to
the hashing of the Asterisk channels. Could the hash table concept be ported
independent of the reference-counted objects for Asterisk channels?</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br>
<br><font size=2 face="sans-serif">Chaitra Bhat | Software Engineer<br>
<br>
LAKE Communications<br>
Beech House, Greenhills Road,<br>
Dublin 24, IRELAND<br>
Int: +353 1 4031067<br>
fax. +353 1 452 0826<br>
www.lakecommunications.com<br>
<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Mark Michelson <mmichelson@digium.com></b>
</font>
<br><font size=1 face="sans-serif">Sent by: asterisk-dev-bounces@lists.digium.com</font>
<p><font size=1 face="sans-serif">01/11/2010 14:34</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
Asterisk Developers Mailing List <asterisk-dev@lists.digium.com></font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">asterisk-dev@lists.digium.com</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">Re: [asterisk-dev] Channel locking mechanism
in Asterisk</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=3>On 11/01/2010 05:06 AM, </font><a href=mailto:chaitra.bhat@lakecommunications.com><font size=3 color=blue><u>chaitra.bhat@lakecommunications.com</u></font></a><font size=3>
wrote: </font>
<br><font size=2 face="sans-serif"><br>
Hi All,</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
We use Asterisk version 1.4.22 in our PBX product. But we have seen that
the locking mechanism that exists in the channel code today is highly inefficient
and CPU consuming. Also, if not careful with the locks order, can lead
to deadlocks.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
So, was wondering if anything has changed with regard to this in the later
versions of Asterisk (1.4 or 1.6). There were talks of introducing a reference
counting mechanism - was this implemented?</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
If I see channel.c and lock.h in 1.4.36, I do not see any changes there
wrt the locking mechanism. And in ver 1.6.2, except for the RW locks, I
do not see any other difference.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Can somebody tell me what changes were introduced in Asterisk 1.6 to manage
and debug the locking of the channels efficiently please?</font><font size=3>
<br>
</font><font size=2 face="sans-serif"><br>
Thanks,</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
-Bhatc</font>
<br><font size=2 face="sans-serif"><br>
You're not going to find any major changes to the channel structure in
the 1.6.X series. In the recently released 1.8 series, the ast_channel
structure has been converted to a reference-counted object and is stored
in a hash table instead of a linked list. The biggest gain here is quicker
lookups of channels. Regarding locking mechanisms, there's not much change
there, so you still need to be careful and respect the defined locking
order. There were a small set of cases where a channel lock was replaced
by grabbing a reference to the channel instead, but there may be 2 or 3
cases of this total in the whole code base.<br>
<br>
Mark Michelson</font><tt><font size=2>-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by http://www.api-digital.com --<br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
http://lists.digium.com/mailman/listinfo/asterisk-dev</font></tt>
<br>
<p align= "justify"><span style="font-family:'Arial';font-size:8pt;">************************************************************************************<br>
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify mailadmin@lakecommunications.com</span></p>
<p align= "justify"><span style="font-family:'Arial';font-size:8pt;"></span></p>
<p align= "justify"><span style="font-family:'Arial';font-size:8pt;"> </span></p>
<p align= "justify"><span style="font-family:'Arial';font-size:8pt;">This footnote also confirms that this email message has been scanned for the presence of computer viruses and other security threats.</span></p>
<p align= "justify"><span style="font-family:'Arial';font-size:8pt;"></span></p>
<p align= "justify"><span style="font-family:'Arial';font-size:8pt;"> </span></p><p><span style="font-family:'Arial';font-size:8pt;">Registered Office: Lake Communications Ltd, Beech House, Greenhills Road, Dublin 24, Ireland.</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">Registered No.         59890</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">************************************************************************************</span></p>
<p><span style="font-family:'Arial';font-size:8pt;"> </span></p>