implemented simple thread caching with central heap