Understanding threadlocal and thread

Source: Internet
Author: User
Understanding threadlocal and thread
Happy source-21:15:05 is the servlet class synchronized by threads? How can I synchronize the time between AGU and 21:15:46 in this province? I don't know-21:16:28 it's best not to use the source of synchronization-21:17:06 is not the same as Struts action> I don't know-21:17:14 write servlet don't define the variables used by the method as class variables .. agu-21:17:23 I don't know how it works! I don't know.-21:17:28 .. struts is also agu-21:17:55 WW2, Which is thread-safe. Agu-21:18:02 action. I don't know-21:18:12 am. Don't bother with Struts-21:18:33, I also think that the ghost-21:19:29 WW2 is the source of thread-safe why-21:19:36 WW2? What is it? Agu-21:19:59 webwork2 binds action and threadlocal to the ghost of the lone soul-21:20:41 to tell the truth. After reading threadlocal for a long time, I didn't understand agu-21:20:57. Can I move a bench at 21:21:05? Happy source-21:21:06 it seems that you have to look at webworks. a lot of new things like agu-21:21:33 webwork have many advantages over Struts-21:22:14 know the ghost-21:22:20 tapestry is a better source of happiness-21:22:32 won't it, why is there another farmer-javen-21:22:37 who will always stand on the shoulders of the former ,. net and Java. Agu-21:22:47 tapestry has many problems. I can't figure it out now.-21:22:57: 21:23:22: threadlocal? Agu-21:23:25. Net's stuff, I think more like taglib, but vs.net supports its visual operations! Farmer-javen-21:24:08 threadlocal is interested. Ghost ghost-21:24:13 ghost-21:24:20 farmer-javen-21:24:08 threadlocal interested in listening. Lone ghost-21:24:25 you are Daniel agu-21:24:43 sorry, I am not very familiar with it! Farmer-javen-21:24:48 dizzy, I don't understand, really. Who told me? I also moved to the stool and sat down and slowly listened to the ghost?-21:25:01 AM, I g it. Agu-21:25:11. I haven't studied it carefully yet, But Robbin has something to do with it.Article Explanation! Happy source-21:25:13 I'll stand and listen to it. Let's go into simple terms-21:25:44 move a stool for the first row of AGU-21:26:38. It feels a bit like a process, but I haven't figured out how it actually works. Can you see it at 21:26:54? threadlocal Source code ! The concept of "21:27:14" also goes deep into simple terms-21:28:08 what stuff? Agu-21:30:57 is free. Please study it! At 21:31:28 a.m., I saw local thread storage in Win32. Agu-21:32:07 is the same? Let's talk about the ghost program-21:32:08 public class threadlocal extends objectvia its get or set method-has its own, independently initialized copy of the variable. What is the ghost program-21:32:34 threadlocal? In fact, threadlocal is not a local implementation version of a thread, it is not a thread, but Thread Local variable (thread local variable ). Deep dive-21:32:48 um, Agu-21:33:32 what is the association with thread? Afei-21:33:35 because the thread only has its own" Program Calculator, execution stack ", without its own process data block, threadlocal provides this mechanism. Alicloud-21:33:49 because the thread only has its own "program counter, execution stack", but does not have its own process data block, threadlocal provides this mechanism. Agu-21:33:49 what is the association with thread? At 21:34:16 a.m., when threadlocal is not introduced, all threads share the data block of the process. It may be more appropriate to name it threadlocalvar at 21:34:17. Threadlocal is a simple function. It provides a copy of the variable value for every thread that uses the variable. Each thread can change its own copy independently, it does not conflict with copies of other threads. Ah Fei-21:34:33 yes. What about data sharing in all counties at 21:34:36? Alicloud-21:35:05 shares data blocks of the same process. Lone soul ghost-21:35:42 threadlocal is similar to multiple processes? A Fei-21:36:45 No. It is a mechanism for allocating reentrant data blocks to each thread-not the execution stack. At 21:37:31 a.m., remember: Win32 allocates 4G address space for each process. Agu-21:39:09 is only the process variable with a local copy of the thread and ?? Afei-21:41:11 1) Each thread must belong to a process. 2) by default, each thread only has a "program counter, execution line ..". A Fei-21:42:48, but when a thread executes two functions, how does one set the value of the 2nd functions. The lone soul ghost-21:43:35 feels like a project, and the process wants the task in it! The ghost program has resources at 21:43:54. For example, if the variable ghost program is completed at 21:44:12, the first task is completed, and the variable of the process is changed, can the second process be used? The lone soul ghost-21:44:22 can have multiple tasks afei-21:44:38. The method is: 1) Pass the stack variable of the 1st function to the 2nd function. 2) use the global variable of the process where the thread is located. 2) How do I synchronize threadlocal with a lone ghost-21:45:25 threadlocal? Agu-21:45:39 don't need to synchronize the ghosts-21:45:47 every thread has a variable, how to give it to others? You changed at 21:45:56 and others did not change. How can you use it at 21:45:58? Do not pass the values for each task from AGU to 21:46:25? Alicloud-21:47:14 threadlocal-is equivalent to dividing the current thread (person) into a dedicated bin. Other users (threads) are not authorized to use this bin except for this thread. Agu-21:47:54 is a bit like a process that is not as heavyweight as a process? The method for passing the stack variable of the 1st function to the 2nd function is as follows: 1. 2) use the global variable of the process where the thread is located. 3. Use threadlocal. So the third one won't work, right? Lone ghost-21:48:24 yes, I feel like the process of the argu-21:48:28 threadlocal is used to protect the local variables of the lone ghost-21:49:48 http://www.yesky.com/SoftChannel/72342371961929728/20031208/1751307.shtml lone ghost-21:50:04 on the technology, I will not talk about it anymore. I will read the article at 21:50:26 am-21:50:35 am-21:51:37 am-I will know about the OS book. In addition, N long ago Win32 core programming-I mentioned threadlocal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.