[asterisk-dev] [Code Review] app_queue change to have one devstate per device not per member / Janitorial cleanups

irroot reviewboard at asterisk.org
Tue Nov 1 09:03:35 CDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/1538/
-----------------------------------------------------------

(Updated Nov. 1, 2011, 9:03 a.m.)


Review request for Asterisk Developers and Matthew Nicholson.


Changes
-------

Ok last of the changes to make it threadsafe with locking member and queues where required and not holding the queue lock while
the members are been walked.

there are many places queue variables are been read not thread safe ive added locking to avoid problems the original program
had a "config" lock latter the queues container that was locked when the queues were been updated preventing most activities on
the objects this is not sufficient.

the only items that can be read with out lock are the queuename and members container in call_queue and the interface in member
the new device state can have its state_interface read accessing member->device->state_interface will require member locked.

the performance should be improved esp in a multi threaded application with many calls.

i have not done extensive testing with this but plan to over the next few days.

appologies for the size of this change set hopefully it will be a step in the right direction for app_queue and base to
add some functionality and features.

ill be adding some doxygen frills once im happy testing it fully in production


Summary
-------

This is a rather large changeset but consists of the following

1)rework adding member records combine duplicate code
2)remove check_state_unknown its not needed any more now that we can reserve a state interface
3)split state information into a new container (devices) the member holds a ref to it allowing shared state devices see above
4)realtime and paused are y/n so add a :1 to them and align bitfields in struct

5)ao2 search callbacks can handle non OBJ_POINTER flag to make ao2_find useful no need to pass obj
6)Reservation of devices to pervent duplicate calls


This addresses bug AST-695.
    https://issues.asterisk.org/jira/browse/AST-695


Diffs (updated)
-----

  /trunk/apps/app_queue.c 342566 

Diff: https://reviewboard.asterisk.org/r/1538/diff


Testing
-------

as most of the above [1,2,4] are removing code not referenced or changing syntax going over the .diff over and over makeing sure it builds and loads.

check state information is propogated and used in app_queue [3,6] 
make sure queues are loaded correctly and changes in [5] have not broken things

backport of app_queue[trunk] to 1.8 [production] has been running 4k+ calls per day for 2 days on this patch.


Thanks,

irroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20111101/2810978e/attachment.htm>


More information about the asterisk-dev mailing list