Day 126: Purpose of thread_context?

I was wondering what the purpose of thread_context is now that multi-threading has added to HH. Does thread_context and win32_thread_info serve the same purpose?

Shouldn't thread_context be used instead of game_memory to pass the queue and function pointers to the game?

/Kim
We haven't really gotten to the point where we need to start caring about thread_context. It's really just there so eventually we can decide to start having per-thread storage (on Windows this is not as much of an issue, because thread local storage actually works, but on other platforms sometimes you do not have that).

- Casey
What other platforms are you talking about? You have working TLS also on Linux, OSX, Android and iOS by using pthread_key_t.
mmozeiko
You have working TLS also on Linux, OSX, Android and iOS by using pthread_key_t.

You might want to try measuring the performance of TLS on those platforms.
Yes, to be more specific, I am talking about "free" access to thread local storage. Every platform gives you a way to eventually get thread local storage, but often times it actually goes through some kind of map that is not at all free.

- Casey