The callback handler class has two thread local variables that can store the user ID and password from the client instance.
这个回调处理器类拥有两个线程本地变量,用于存储来自客户端实例的用户ID和密码。
It includes stack frames and local variables, but unlike a true thread it is not executable.
它包含了栈帧和局部变量,但与真正的线程不同的是它无法执行。
Key things to note here are the thread local storage declarations and the instance variables used to hold the potential source of the username and password.
这里需要注意的关键内容是用于存放用户名和密码的可能来源的线程本地存储声明和实例变量。
If the variables in your applications are not going to change, then a thread-local cache makes sense.
如果应用程序中的变量将不发生变化,那么一个线程局部缓存比较行得通。
You could consider these "thread-local" copies of variables to be similar to a cache, helping the thread avoid checking main memory each time it needs to access the variable's value.
您可以将变量的这些“线程局部”副本看作是与缓存类似,在每次线程需要访问变量的值时帮助它避免检查主存储器。
Instead, the thread class was modified to support ThreadLocal by adding an instance variable to thread that holds a HashMap mapping thread-local variables to their values for the current thread.
相反地,人们通过给Thread添加一个实例变量(该变量用于保存当前线程的从线程局部变量到它的值的映射的HashMap)来修改thread类以支持ThreadLocal。
Every thread in an application requires memory to hold its stack (the area of memory used to hold local variables and maintain state when calling functions).
应用程序中的每个线程都需要内存来保存它的栈(用于在调用函数时保存本地变量和维持状态的内存区)。
Reentrancy is easy-most variables are local variables on the stack and are allocated exclusively for each thread executing a function.
重入是容易的—大多数变量是栈上的本地变量且是线程专有地分配来执行函数。
It's just a way to communicate with the coroutine scheduler without using global (or thread-local) variables.
它只是一种方法与协同调度通信而不需要使用全局(或局部)变量。
It's just a way to communicate with the coroutine scheduler without using global (or thread-local) variables.
它只是一种方法与协同调度通信而不需要使用全局(或局部)变量。
应用推荐