miconda left a comment (kamailio/kamailio#4539)

@zenichev: thanks for the detailed explanation!

So you introduced a reload lock/mutex, that practically blocks other processes 
doing reloading once such operation is in progress. The switch to hash table is 
not related to the reload issue, just considered a better design to store the 
items?

Although not the main author of the module, I think the secondary table was 
kept (at least for a while) to ensure that SIP worker processes finish matching 
on the old active list when a reload is completed.

Probably I have to look at the code, since I still have some doubts: with your 
new approach, when you expect 2-3 processes to do reload immediately one after 
the other, if 1st reloading process swaps the active (old data) with secondary 
(new data) and there is a SIP worker still walking through the old data, then 
the 2nd reloading process completes the reload and swaps again, could it happen 
that the SIP worker is still walking the old-old-data, which has to be 
destroyed by the 2nd reloading process more or less at the same time?

Also, I haven't gotten (yet) the idea with the dummy item. Normally the bucket 
is its own structure, where the bucket lock is kept  as well as the pointer to 
the first item (maybe along with some other fields/statistics, like number of 
items) and the items are just holding the data. So the bucket structures are 
initialized only once, at startup, only the `first-item` field changes at 
runtime (concerting the stored data there, other fields might change as well, 
like the mentioned example of number of items).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4539#issuecomment-3769076449
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4539/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to