Sorry to ask so many questions this week.
I assume that the thread index returned by thread.get_id implementation specific. In the case of pthreads, is the index reused? IE, if thread 0 is started and combined, is the thread started after the words have a different identifier?
the reason I ask for this is the need to implement the Singleton template with a twist: each thread gets its own instance. I know this sounds very crazy, but threads control the hardware (cuda), which does not allow device memory sharing even at the thread level.
What is a good way to implement such a pattern?
source share