Details
-
Task
-
Status: Resolved
-
Not specified
-
Resolution: Fixed
-
None
-
None
Description
Currently jlib maintains a list of active threads which is used for displaying in the stack trace and also in the process monitor for mapping busy threads.
Maintaining this list adds an overhead
- critical sections at the start and end
The critical sections don't add very much
- maintaining the array.
If there are large numbers of threads then using an array is inefficient because removing them becomes expensive (3,000 threads ~2us 30,000 threads ~15us).
See branch ghalliday/activeThreadLinkedList for an implementation. It seems to slow down small threads a little (but hard to tell because of variations in timings).