[gameprogrammer] Re: Portable thread local storage?

  • From: Nicolas Goy <kuon@xxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sat, 5 Dec 2009 11:04:12 +1100

On 5 déc. 2009, at 09:15, Bob Pendleton wrote:
> 
> 
> Ah, that makes sense. So, why not use the thread ID to select the
> context inside the API?

This is funny because reading the other answer I was about to suggest that.

I use this mechanism in one of my libraries to select the current pipeline 
(same concept as yours, my brain was just unable to think of it).

I use GetThreadId on win32 and pthread_self on POSIX. Works well.

Kuon

Other related posts: