Java multi-thread learning 2-thread stack model and thread Variables

Source: Internet
Author: User
Java thread: thread stack model and thread variable Scjp5 Study NotesTo understand the Thread Scheduling Principle and the thread execution process, you must understand the thread stack model. The thread stack refers to the stack information of Thread Scheduling in the memory at a certain time point. The method currently called is always at the top of the stack. The content of the thread stack is ProgramTherefore, to study the thread stack, You must select a runtime (actually Code). The following uses an exemplary code to explain the change process of the thread (CALL) stack. This figure describes the Virtual Machine thread call stack when the code is executed at two different times: 1 and 2. When the program runs to T. Start ();, the program has an extra Branch (with a call stack B added). In this way, stack a and stack B are executed in parallel. Here we can see the difference between method calling and thread startup.

From http://lavasoft.blog.51cto.com/62575/99152

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.