Use thread-local storage for global program cache