added support for counting process threads