ywkaras commented on PR #9394: URL: https://github.com/apache/trafficserver/pull/9394#issuecomment-1435775317
ts::scalable_shared_mutex uses the class DenseThreadId ( https://github.com/apache/trafficserver/pull/9154/files#diff-5d4184d5004b8c73554cb88f0bfe7f0c4711c7394c5a15e24daaaff8962d1076R177 ). It provides a thread ID for currently running threads, that's in the range from 0 to one less than the number of currently-running threads. A new thread may reuse the ID of an exited thread. (This could be a performance issue with dynamic threading, but ATS seems to do little of that.) So `dense thread ID % num slots` would then be a reasonable hash function, with perhaps fewer collisions. ts::scalable_shared_mutex always assume there are at least as many slots as currently running threads. This avoids complex logic to deal with collisions. I notice that you hard-coded 4096 as the number of slots. I suspect there are few if any ATS proxies in prod that run optimally with more than 4096 simultaneously active threads. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
