I've just been doing a little thinking and reading about improving the
scalability of the C++ broker: One of the things that occurred to me is
that some things may be improved by using thread local variables to
avoid globally shared state and hence locking. In particular in places
where things are guaranteed to happen on the same thread - for example
the processing of an incoming frame.
Looking into this it appears that gcc has an extension that allows you
to declare thread local variables ("__thread"). Previously I've used the
equivalent Visual Studio magic (something like __declspec(thread)), so I
imagine it's a widespread extension.
Does anyone have experience of using thread local vars with these
extensions? Are there any opinions about using a non-standard feature
like this in a core place in the C++ broker?
Andrew