There are several static __thread
variables in the static __thread
. If the kernel switches the thread context, then there are no problems. If you independently switch the context of stream 1 to stream 2, then stream 2 will see the local variables of stream 1, which does not suit me at all.
Unfortunately, I did not find standard tools to quickly switch between threads, and the coroutine mechanisms do not know anything about the __thread
variables.
Hence the question, is it possible and how to switch the context of variables of type __thread
?
PS: If something is not clear, ask, I will clarify. Questions like: why / why - are ignored, who do not like someone - I do not force them to answer.
gcc .... -pthread -lpthread
- sergw