当前位置:网站首页>JVM memory model: PC program counters
JVM memory model: PC program counters
2022-07-22 16:31:00 【Twilight_ years】
JVM Program counter in (Program Counter Register) in ,Register The name of comes from CPU The register of , Registers store instruction related thread information , there PC Not a generalized physical register .PC Registers are used to store the address to the next instruction , Also about to execute the instruction code , The execution engine reads the next instruction .
PC Register Introduce :
* Memory space is very small , I can almost ignore it , The fastest running storage area .
* stay JVM Specification , Each thread has its own program counter , Threads are private , The life cycle is consistent with the declaration cycle of the thread .
* There is only one method in a thread at any time , That is, the current method . The program counter stores what the current thread is executing Java Methodical JVM Instruction assignment . If executed native Method , It is undefined
*PC Register It's an indicator of the flow of program control , Branch loop , Jump , exception handling , Basic functions such as thread recovery rely on this counter .
* The bytecode interpreter works by changing the value of this counter to select the next bytecode instruction to execute .
* No, OOM and GC.
Why? PC Registers store instruction addresses ?
CPU You need to switch threads all the time , Now, after switching back , You need to know where to start and continue .
JVM Bytecode interpreter of passed PC The counter knows what bytecode instruction should be executed next .
Why? PC Registers are thread private ?
CPU Keep switching tasks when multithreading , This will cause interruption or recovery , In order to be able to prepare to record the current bytecode instruction address of each thread , The best way is to allocate each thread should PC register .
边栏推荐
- Signal FFT, STFT, wavelet transform, envelope analysis, etc
- Detailed explanation of PN communication between botu PLC and ABB Inverter
- Kalman filter program of POTU PLC signal processing series
- 学生如何提高专业英文阅读能力丨传道授业
- Figure calculation - figure introduction
- EasyCVR平台级联时,出现报错提示端口不可达是什么原因?
- 红队怎么打
- 一个15年ABAP老兵的建议:了解这些基础知识,对ABAP开发有百利而无一害
- Docker data management case - MySQL data persistence
- Leetcode 234. 回文链表
猜你喜欢
[ssm]ssm integration ① (integration configuration)
Session共享问题
自动化测试工程师面试简历参考
The two supply chain centers of HEMA launched the "background" of innovative research and development of multi format commodities
Vulkan-官方示例解读-子通道
AlterNET脚本编写,用户界面设计功能
STM32基于HAL库的非DMA的轮询ADC单通道与多通道的采样
Soc之按键控制LED
Evening Sky
Elephant Swap的LaaS方案迅速崛起,构建全新DeFi2.0协议
随机推荐
Automated Test Engineer Interview resume reference
[unity project practice] game architecture
Signal FFT, STFT, wavelet transform, envelope analysis, etc
Write a function in C language to delete the spaces in the string and return the number of spaces
Switch and router technology: Standard ACL, extended ACL and named ACL
分布式调度框架Elastic-Job
SFTP creation
嵌套子查询
信号FFT、STFT、小波变换、包络分析等
[SSM]SSM整合③(接口测试)
进程和线程面试问题
Mock simulates data and initiates get and post requests (nanny level tutorials are sure to succeed)
Network layer interview questions
JVM内存模型:类加载过程
Window startup add / close
[solution] solve the importerror: library "Glu" not found
【解决方案】解决paddlepaddle运行强化学习代码时TypeError: fc() got an unexpected keyword argument ‘is_test‘的错误
交换机与路由器技术:标准ACL、扩展ACL和命名ACL
网络相关概念面试题
万亿市值公链竞争白热化,新公链还有机会吗?