Artifacts Associated With Ticket 3563391fffffffffffffffffffffffffffffffff
Ticket change [3979761342] (rid 112393) by dgp on 2012-08-30 17:00:33:
- assignee initialized to: "vasiljevic"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The struct SpBucket declared in threadSpCmd.h has two fields, lockt and freeCt, that are never used anywhere. In the interest of simplification, I request we remove them. I would also like some comments added explaining the default value of #define NUMSPBUCKETS 32 and why someone customizing Thread source code might choose some other value. I think I'd be just as happy with a value of 1 myself, but that may be an opinion founded in ignorance.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "80. Thread Package"
- title initialized to: "Drop unused SpBucket fields"
- type initialized to: "RFE"
Ticket change [96e4be5d76] (rid 106406) by vasiljevic on 2012-09-13 16:54:21:
- icomment:
The "lockt" has been removed. The "freeCt" is used in the code as the top of free container list (similar to the list of pre-allocated Tcl Objs) and cannot be removed. The NUMSPBUCKETS is a count of slots containing shared arrays. Instead of locking the array during access, the slot (bucket) containing the array is locked. Arrays are distributed among buckets using a simple hash that maps the array name into one of the buckets. The whole logic was "borrowed" from AOL/Naviserver. Setting the value larger will reduce locking contention for the bucket and thus allow more concurrency. Unfortunately we do not have any metrics built into the code that would allow locking introspection and finding "hot" buckets. This would be necessary in order to experiment with the number of buckets. The value of 32 is found to be "good enough" for most of the applications.
- login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"
- icomment:
Ticket change [e948b8c16d] (rid 104796) by dgp on 2012-09-13 20:34:59:
- icomment:
Thanks for reviewing the request. It's not urgent, but good to have others having a look. The "lockt" field is still present in the SpBucket struct on the trunk. I doubt that the "freeCt" is used in the way you claim. (Don't confuse it with the field of the same name in the Bucket struct in threadSvCmd.h) I've had the field commented out for many many weeks in a local sandbox with no apparent ill effect. If I'm overlooking something, then adding something to the test suite that would notice this field being missing would be a good thing to do.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e6e32a9f1a] (rid 104366) by vasiljevic on 2012-09-13 20:44:24:
- icomment:
You are right about the freeCt. It is defined twice but one of the instances is unnecessary. I overlooked that. Will remove that now. Apropos lockt... It is removed and I "fossil push"ed so I cannot explain why you still see it. In my sandbox it is gone.
- login: "vasiljevic"
- mimetype: "text/plain"
- username: "vasiljevic"
- icomment:
Ticket change [d6981ff413] (rid 123831) by dgp on 2012-09-13 20:53:13:
- closedate changed to: "2012-09-13T13:53:13"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 Got it now. Thanks!
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"
- username: "dgp"