openjdk11 jvm视角查看java线程异常退出synchronized锁自动释放

news2024/11/13 15:11:31

##synchronized锁异常 java代码demo

public class ThreadTest {

    public int mul = 1;

    public static void main(String[] args) {
        ThreadTest threadTest = new ThreadTest();
        Thread yym_user_thread1 = new Thread() {
            public void run() {
                System.out.println("yym_user_thread1");
                threadTest.resources(0);
            }
        };
        yym_user_thread1.setName("yym_user_thread1");
        yym_user_thread1.start();
        //
        //
        Thread.yield();Thread.yield();Thread.yield();
        Thread.yield();Thread.yield();Thread.yield();
        Thread yym_user_thread2 = new Thread() {
            public void run() {
                System.out.println("yym_user_thread2");
                threadTest.resources(1);
            }
        };
        yym_user_thread2.setName("yym_user_thread2");
        yym_user_thread2.start();
    }

    public  void resources(int number) {
        synchronized(this) {
            for (int i = 0; i < 10000; i++) {
                mul++;
            }
            int result = mul / number;
            System.out.println("resources" + result);
        }
    }

}

##javap -v ThreadTest 查看monitorenter monitorexit字节码

major version: 55
  flags: (0x0021) ACC_PUBLIC, ACC_SUPER
  this_class: #3                          // ThreadTest
  super_class: #17                        // java/lang/Object
  interfaces: 0, fields: 1, methods: 3, attributes: 4
{0x0000000705f0f9a0}Constant pool:
{0x0000000705f2dd10}   #1 = Methodref          #17.#34        // java/lang/Object."<init>":()V
   #2 = Fieldref           #3.#35         // ThreadTest.mul:I
{0x0000000705fc52e0}   #3 = Class              #36            // ThreadTest
   #4 = Methodref          #3.#34         // ThreadTest."<init>":()V
   #5 = Class              #37            // ThreadTest$1
   #6 = Methodref          #5.#38         // ThreadTest$1."<init>":(LThreadTest;)V
   #7 = String             #39            // yym_user_thread1
   #8 = Methodref          #40.#41        // java/lang/Thread.setName:(Ljava/lang/String;)V
   #9 = Methodref          #40.#42        // java/lang/Thread.start:()V
  #10 = Methodref          #40.#43        // java/lang/Thread.yield:()V
  #11 = Class              #44            // ThreadTest$2
  #12 = Methodref          #11.#38        // ThreadTest$2."<init>":(LThreadTest;)V
  #13 = String             #45            // yym_user_thread2
  #14 = Fieldref           #46.#47        // java/lang/System.out:Ljava/io/PrintStream;
{0x000000070610aa38}{0x0000000706114b80}{0x000000070613dfd0}  #15 = InvokeDynamic      #0:#51         // #0:makeConcatWithConstants:(I)Ljava/lang/String;
  #16 = Methodref          #52.#53        // java/io/PrintStream.println:(Ljava/lang/String;)V
  #17 = Class              #54            // java/lang/Object
  #18 = Utf8               InnerClasses
  #19 = Utf8               mul
  #20 = Utf8               I
  #21 = Utf8               <init>
  #22 = Utf8               ()V
  #23 = Utf8               Code
  #24 = Utf8               LineNumberTable
  #25 = Utf8               main
  #26 = Utf8               ([Ljava/lang/String;)V
  #27 = Utf8               resources
  #28 = Utf8               (I)V
  #29 = Utf8               StackMapTable
  #30 = Class              #55            // java/lang/Throwable
  #31 = Utf8               SourceFile
  #32 = Utf8               ThreadTest.java
  #33 = Utf8               NestMembers
  #34 = NameAndType        #21:#22        // "<init>":()V
  #35 = NameAndType        #19:#20        // mul:I
  #36 = Utf8               ThreadTest
  #37 = Utf8               ThreadTest$1
  #38 = NameAndType        #21:#56        // "<init>":(LThreadTest;)V
  #39 = Utf8               yym_user_thread1
  #40 = Class              #57            // java/lang/Thread
  #41 = NameAndType        #58:#59        // setName:(Ljava/lang/String;)V
  #42 = NameAndType        #60:#22        // start:()V
  #43 = NameAndType        #61:#22        // yield:()V
  #44 = Utf8               ThreadTest$2
  #45 = Utf8               yym_user_thread2
  #46 = Class              #62            // java/lang/System
  #47 = NameAndType        #63:#64        // out:Ljava/io/PrintStream;
  #48 = Utf8               BootstrapMethods
{0x0000000706184b20}  #49 = MethodHandle       6:#65          // REF_invokeStatic java/lang/invoke/StringConcatFactory.makeConcatWithConstants:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
  #50 = String             #66            // resources\u0001
  #51 = NameAndType        #67:#68        // makeConcatWithConstants:(I)Ljava/lang/String;
  #52 = Class              #69            // java/io/PrintStream
  #53 = NameAndType        #70:#59        // println:(Ljava/lang/String;)V
  #54 = Utf8               java/lang/Object
  #55 = Utf8               java/lang/Throwable
  #56 = Utf8               (LThreadTest;)V
  #57 = Utf8               java/lang/Thread
  #58 = Utf8               setName
  #59 = Utf8               (Ljava/lang/String;)V
  #60 = Utf8               start
  #61 = Utf8               yield
  #62 = Utf8               java/lang/System
  #63 = Utf8               out
  #64 = Utf8               Ljava/io/PrintStream;
  #65 = Methodref          #71.#72        // java/lang/invoke/StringConcatFactory.makeConcatWithConstants:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
  #66 = Utf8               resources\u0001
  #67 = Utf8               makeConcatWithConstants
  #68 = Utf8               (I)Ljava/lang/String;
  #69 = Utf8               java/io/PrintStream
  #70 = Utf8               println
  #71 = Class              #73            // java/lang/invoke/StringConcatFactory
  #72 = NameAndType        #67:#76        // makeConcatWithConstants:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
  #73 = Utf8               java/lang/invoke/StringConcatFactory
  #74 = Class              #78            // java/lang/invoke/MethodHandles$Lookup
  #75 = Utf8               Lookup
  #76 = Utf8               (Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
  #77 = Class              #79            // java/lang/invoke/MethodHandles
  #78 = Utf8               java/lang/invoke/MethodHandles$Lookup
  #79 = Utf8               java/lang/invoke/MethodHandles
{
  public int mul;
{0x00000007061ad120}    descriptor: I
    flags: (0x0001) ACC_PUBLIC

  public ThreadTest();
    descriptor: ()V
    flags: (0x0001) ACC_PUBLIC
    Code:
{0x00000007061d5a80}{0x000000070601ee30}      stack=2, locals=1, args_size=1
         0: aload_0
         1: invokespecial #1                  // Method java/lang/Object."<init>":()V
         4: aload_0
         5: iconst_1
         6: putfield      #2                  // Field mul:I
         9: return
      LineNumberTable:
        line 1: 0
        line 3: 4

  public static void main(java.lang.String[]);
    descriptor: ([Ljava/lang/String;)V
    flags: (0x0009) ACC_PUBLIC, ACC_STATIC
    Code:
      stack=3, locals=4, args_size=1
         0: new           #3                  // class ThreadTest
         3: dup
         4: invokespecial #4                  // Method "<init>":()V
         7: astore_1
         8: new           #5                  // class ThreadTest$1
        11: dup
        12: aload_1
        13: invokespecial #6                  // Method ThreadTest$1."<init>":(LThreadTest;)V
        16: astore_2
        17: aload_2
        18: ldc           #7                  // String yym_user_thread1
        20: invokevirtual #8                  // Method java/lang/Thread.setName:(Ljava/lang/String;)V
        23: aload_2
        24: invokevirtual #9                  // Method java/lang/Thread.start:()V
        27: invokestatic  #10                 // Method java/lang/Thread.yield:()V
        30: invokestatic  #10                 // Method java/lang/Thread.yield:()V
        33: invokestatic  #10                 // Method java/lang/Thread.yield:()V
        36: invokestatic  #10                 // Method java/lang/Thread.yield:()V
        39: invokestatic  #10                 // Method java/lang/Thread.yield:()V
        42: invokestatic  #10                 // Method java/lang/Thread.yield:()V
        45: new           #11                 // class ThreadTest$2
        48: dup
        49: aload_1
        50: invokespecial #12                 // Method ThreadTest$2."<init>":(LThreadTest;)V
        53: astore_3
        54: aload_3
        55: ldc           #13                 // String yym_user_thread2
        57: invokevirtual #8                  // Method java/lang/Thread.setName:(Ljava/lang/String;)V
        60: aload_3
        61: invokevirtual #9                  // Method java/lang/Thread.start:()V
        64: return
      LineNumberTable:
        line 6: 0
        line 7: 8
        line 13: 17
        line 14: 23
        line 17: 27
        line 18: 36
        line 19: 45
        line 25: 54
        line 26: 60
        line 27: 64

  public void resources(int);
    descriptor: (I)V
    flags: (0x0001) ACC_PUBLIC
    Code:
      stack=3, locals=5, args_size=2
         0: aload_0
         1: dup
         2: astore_2
         3: monitorenter
         4: iconst_0
         5: istore_3
         6: iload_3
         7: sipush        10000
        10: if_icmpge     29
        13: aload_0
        14: dup
        15: getfield      #2                  // Field mul:I
        18: iconst_1
        19: iadd
        20: putfield      #2                  // Field mul:I
        23: iinc          3, 1
        26: goto          6
        29: aload_0
        30: getfield      #2                  // Field mul:I
        33: iload_1
        34: idiv
        35: istore_3
        36: getstatic     #14                 // Field java/lang/System.out:Ljava/io/PrintStream;
        39: iload_3
        40: invokedynamic #15,  0             // InvokeDynamic #0:makeConcatWithConstants:(I)Ljava/lang/String;
        45: invokevirtual #16                 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
        48: aload_2
        49: monitorexit
        50: goto          60
        53: astore        4
        55: aload_2
        56: monitorexit
        57: aload         4
        59: athrow
        60: return
      Exception table:
         from    to  target type
             4    50    53   any
            53    57    53   any
      LineNumberTable:
        line 30: 0
        line 31: 4
        line 32: 13
        line 31: 23
        line 34: 29
        line 35: 36
        line 36: 48
        line 37: 60
      StackMapTable: number_of_entries = 4
        frame_type = 253 /* append */
          offset_delta = 6
          locals = [ class java/lang/Object, int ]
        frame_type = 250 /* chop */
          offset_delta = 22
        frame_type = 87 /* same_locals_1_stack_item */
          stack = [ class java/lang/Throwable ]
        frame_type = 250 /* chop */
          offset_delta = 6
}
SourceFile: "ThreadTest.java"
NestMembers:
  ThreadTest$2
  ThreadTest$1
InnerClasses:
  #11;                                    // class ThreadTest$2
  #5;                                     // class ThreadTest$1
  public static final #75= #74 of #77;    // Lookup=class java/lang/invoke/MethodHandles$Lookup of class java/lang/invoke/MethodHandles
BootstrapMethods:
  0: #49 REF_invokeStatic java/lang/invoke/StringConcatFactory.makeConcatWithConstants:(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/invoke/CallSite;
    Method arguments:
      #50 resources\u0001

##gdb线程栈  异常处理

(gdb) c
Continuing.
@@@@-yym-Thread PID: 4160
@@@@-yym-Thread NAME: yym_user_thread2
yym_user_thread2
[Switching to Thread 0x7fffc9d6c700 (LWP 4157)]

Thread 18 "C2 CompilerThre" hit Breakpoint 4, JavaThread::exit (this=0x7fffa4220800, destroy_vm=false, exit_type=JavaThread::normal_exit)
    at /home/yym/code/jdk11u-master/src/hotspot/share/runtime/thread.cpp:1917
1917      this->clear_pending_exception();
(gdb) c
Continuing.
[Switching to Thread 0x7fffc9b6a700 (LWP 4159)]

Thread 20 "yym_user_thread" hit Breakpoint 4, JavaThread::exit (this=0x7ffff07bd800, destroy_vm=false, exit_type=JavaThread::normal_exit)
    at /home/yym/code/jdk11u-master/src/hotspot/share/runtime/thread.cpp:1917
1917      this->clear_pending_exception();
(gdb) s
ThreadShadow::clear_pending_exception (this=0x7ffff07bd800) at /home/yym/code/jdk11u-master/src/hotspot/share/utilities/exceptions.cpp:59
59      void ThreadShadow::clear_pending_exception() {
(gdb) list
54        _pending_exception = exception;
55        _exception_file    = file;
56        _exception_line    = line;
57      }
58
59      void ThreadShadow::clear_pending_exception() {
60        LogTarget(Debug, exceptions) lt;
61        if (_pending_exception != NULL && lt.is_enabled()) {
62          ResourceMark rm;
63          LogStream ls(lt);
(gdb) n
60        LogTarget(Debug, exceptions) lt;
(gdb) p exception
No symbol "exception" in current context.
(gdb) n
61        if (_pending_exception != NULL && lt.is_enabled()) {

 ##抛出异常

##方法退出

 ##gdb调试

(gdb) b thread.cpp:1917

(gdb) p *_pending_exception
$8 = {_mark = 0x7ffff07bd805, _metadata = {_klass = 0xe294f72300014610, _compressed_klass = 83472}}
(gdb) call _pending_exception->print_on(tty)
java.lang.ArithmeticException
{0x0000000714a7b8f0} - klass: 'java/lang/ArithmeticException'
 - ---- fields (total size 5 words):
 - private transient 'backtrace' 'Ljava/lang/Object;' @12  a 'java/lang/Object'[5] {0x0000000714a7b918} (e294f723)
 - private 'detailMessage' 'Ljava/lang/String;' @16  "/ by zero"{0x0000000714a7b8b8} (e294f717)
 - private 'cause' 'Ljava/lang/Throwable;' @20  a 'java/lang/ArithmeticException'{0x0000000714a7b8f0} (e294f71e)
 - private 'stackTrace' '[Ljava/lang/StackTraceElement;' @24  a 'java/lang/StackTraceElement'[0] {0x0000000715120a70} (e2a2414e)
 - private strict 'suppressedExceptions' 'Ljava/util/List;' @28  a 'java/util/Collections$EmptyList'{0x000000071510bb90} (e2a21772)
 - private transient 'depth' 'I' @32  2
(gdb) bt
#0  ThreadShadow::clear_pending_exception (this=0x7ffff07bd800) at /home/yym/code/jdk11u-master/src/hotspot/share/utilities/exceptions.cpp:61
#1  0x00007ffff6173b7c in JavaThread::exit (this=0x7ffff07bd800, destroy_vm=false, exit_type=JavaThread::normal_exit)
    at /home/yym/code/jdk11u-master/src/hotspot/share/runtime/thread.cpp:1917
#2  0x00007ffff61738ef in JavaThread::thread_main_inner (this=0x7ffff07bd800) at /home/yym/code/jdk11u-master/src/hotspot/share/runtime/thread.cpp:1875
#3  0x00007ffff617374a in JavaThread::run (this=0x7ffff07bd800) at /home/yym/code/jdk11u-master/src/hotspot/share/runtime/thread.cpp:1850
#4  0x00007ffff616f8eb in Thread::call_run (this=0x7ffff07bd800) at /home/yym/code/jdk11u-master/src/hotspot/share/runtime/thread.cpp:387
#5  0x00007ffff5f703fd in thread_native_entry (thread=0x7ffff07bd800) at /home/yym/code/jdk11u-master/src/hotspot/os/linux/os_linux.cpp:827
#6  0x00007ffff71c56ba in start_thread (arg=0x7fffc9b6a700) at pthread_create.c:333
#7  0x00007ffff790051d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb)

##yym_user_thread1释放锁

(gdb) set args ThreadTest
(gdb) handle SIGSEGV pass noprint nostop
Signal        Stop      Print   Pass to program Description
SIGSEGV       No        No      Yes             Segmentation fault
(gdb) handle SIGFPE pass noprint nostop
Signal        Stop      Print   Pass to program Description
SIGFPE        No        No      Yes             Arithmetic exception
(gdb) b thread.cpp:1917
(gdb) b ObjectMonitor::exit
(gdb)b ObjectMonitor::ExitEpilog

InterpreterRuntime::monitorexit (thread=0x7ffff06c6800, elem=0x7fffc9b695d8) at /home/yym/code/jdk11u-master/src/hotspot/share/interpreter/interpreterRuntime.cpp:801
801       elem->set_obj(NULL);
(gdb) n
803       thread->last_frame().interpreter_frame_verify_monitor(elem);
(gdb) n
788     IRT_ENTRY_NO_ASYNC(void, InterpreterRuntime::monitorexit(JavaThread* thread, BasicObjectLock* elem))
(gdb) p thread->print_on(tty)
"yym_user_thread1" #12 prio=5 os_prio=0 cpu=1.74ms elapsed=132.10s tid=0x00007ffff06c6800 nid=0x2163 runnable  [0x00007fffc9b69000]
   java.lang.Thread.State: RUNNABLE
   JavaThread state: _thread_in_vm
Thread: 0x00007ffff06c6800  [0x2163] State: _call_back _has_called_back 0 _at_poll_safepoint 0
   JavaThread state: _thread_in_vm
$7 = void
(gdb)

##唤醒其他线程

(gdb) n
[Switching to Thread 0x7fffc9b6a700 (LWP 9733)]

Thread 20 "yym_user_thread" hit Breakpoint 4, ObjectMonitor::ExitEpilog (this=0x7fffb0008b80, Self=0x7ffff072f000, Wakee=0x7fffc9a68600)
    at /home/yym/code/jdk11u-master/src/hotspot/share/runtime/objectMonitor.cpp:1283
1283      assert(_owner == Self, "invariant");
(gdb) n
1291      _succ = Knob_SuccEnabled ? Wakee->_thread : NULL;
(gdb) n
1292      ParkEvent * Trigger = Wakee->_event;

##main释放锁-等待日后验证,现阶段不知道干啥的

(gdb) b thread.cpp:2040

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2069156.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【C++题解】1147. 求1/1+1/2+2/3+3/5+5/8+8/13+13/21……的前n项的和

欢迎关注本专栏《C从零基础到信奥赛入门级&#xff08;CSP-J&#xff09;》 问题&#xff1a;1147. 求1/11/22/33/55/88/1313/21……的前n项的和 类型&#xff1a;函数 题目描述&#xff1a; 求1/11/22/33/55/88/1313/2121/34…的前 n 项的和。 输入&#xff1a; 输入一个…

WPF—路由事件详解

WPF—路由事件 路由事件是一种可以针对元素树中的多个侦听器而不是仅仅针对引发该事件的对象调用处理程序的事件。路由事件是一个CLR事件。 路由事件与一般事件的区别在于&#xff1a;路由事件是一种用于元素树的事件&#xff0c;当路由事件触发后&#xff0c;它可以向上或向…

C++ | Leetcode C++题解之第371题两整数之和

题目&#xff1a; 题解&#xff1a; class Solution { public:int getSum(int a, int b) {while (b ! 0) {unsigned int carry (unsigned int)(a & b) << 1;a a ^ b;b carry;}return a;} };

微程序控制器的设计

目录 一、微程序控制器的原理 1.模仿高级语言思想到微程序&#xff1a; 2.采用存储程序思想到CU内构造&#xff1a; 3.微程序执行过程&#xff1a; 二、微指令的设计 1.前置概念&#xff1a; 相容性微命令&#xff1a; 互斥性微命令&#xff1a; 2.微指令格式 水平…

作者推荐 |【Redis技术进阶之路】「技术提升系列」夯实基础分析探究ziplist压缩列表的点点滴滴

揭秘高效存储模型与数据结构底层实现 【专栏简介】【技术大纲】【专栏目标】【目标人群】1. Redis爱好者与社区成员2. 后端开发和系统架构师3. 计算机专业的本科生及研究生 压缩列表&#xff08;ziplist&#xff09;压缩列表使用目的压缩列表结构组成压缩列表的各个组成部分三个…

flv格式分析与解复用

介绍 FLV(Flash Video)是Adobe公司推出的⼀种流媒体格式&#xff0c;由于其封装后的⾳视频⽂件体积⼩、 封装简单等特点&#xff0c;⾮常适合于互联⽹上使⽤。⽬前主流的视频⽹站基本都⽀持FLV。采⽤FLV 格式封装的⽂件后缀为.flv。 FLV封装格式是由⼀个⽂件头(file header)和 …

0基础深度学习项目13:基于TensorFolw实现天气识别

&#x1f368; 本文为&#x1f517;365天深度学习训练营 中的学习记录博客&#x1f356; 原作者&#xff1a;K同学啊 目录 一、创建环境二、前期准备2.1 设置GPU2.2 导入数据2.3 数据预处理2.3.1 加载数据2.3.2 查看图像的标签 2.4 数据可视化 三、构建简单的CNN网络&#xff0…

NVDLA专题12:具体模块介绍——RUBIK

概述 RUBIK类似于BDMA&#xff0c;它无需任何数据计算对数据映射格式进行转换。RUBIK有3种工作模式&#xff0c;分别是: 合并(Contract)数据立方体将特征数据立方体分割为多平面&#xff08;multi-planar&#xff09;格式将多平面(multi-planar)格式合并到数据立方体 由于该…

第三十八篇-TeslaP40-SenseVoice部署,速速杠杠的

环境 系统&#xff1a;CentOS-7 CPU: 14C28T 内存&#xff1a;32G 显卡&#xff1a;Tesla P40 24G 驱动: 535 CUDA: 12.2创建环境 conda create -n sv python3.11 -y conda activate sv克隆 git clone https://github.com/FunAudioLLM/SenseVoice.git cd SenseVoice配置镜像…

React antd Table表格动态合并单元格

注意&#xff1a; ① 采用的是React antDsign 4.x版本 ② 需重新处理data数据 实现效果 代码实现 import React from react; import { Table } from antd;const data [{key: 0,name: 张三,age: 22,sex: 男,},{key: 1,name: 李四,age: 42,sex: 男,},{key: 2,name: 小丽,age: …

CAN的协议层介绍

一&#xff0c;CAN帧种类介绍 1. 数据帧&#xff08;Data Frame&#xff09;&#xff1a;数据帧是CAN总线上用于传输用户数据的帧&#xff0c;包括必要的帧头、标识符、控制位、数据长度代码、数据域、CRC校验码和应答域等部分&#xff0c;是CAN通信中最基本和最重要的帧类型。…

Android Room DataBase

Room数据库是在Sqlite的基础上&#xff0c;进行了封装和优化。这让我们可以摆脱&#xff0c;繁琐的数据库操作 在module的gradle里面&#xff0c;加入: dependencies {annotationProcessor "androidx.room:room-compiler:2.3.0"implementation androidx.room:room-…

Selenium自动化测试 常见API的使用

本篇文章内容是关于 Selenium 自动化测试工具的常见 API 的使用 Selenium版本&#xff1a;4.23.1 编程语言&#xff1a;Java JDK22 编译器&#xff1a;IDEA 2024.2.0.2 浏览器版本&#xff1a;谷歌浏览器128.0.6613.36&#xff08;正式版本&#xff09; &#xff08;64 位&…

【Hexo】hexo-butterfly主题添加装备展示页面

本文首发于 ❄️慕雪的寒舍 在翻开往的时候看到了一位老哥的博客里面正好有这个教程&#xff0c;整了一下发现效果还不错&#xff01; Hexo的Butterfly魔改教程&#xff1a;我的装备&#xff0c;分享你在用的设备 | 张洪HeoHexo博客添加自定义css和js文件 | Leonus 注&#x…

Python个人收入影响因素模型构建:回归、决策树、梯度提升、岭回归|数据分享...

全文链接&#xff1a;https://tecdat.cn/?p37423 分析师&#xff1a;Greata Xie “你的命运早在出生那一刻起便被决定了。”这样无力的话语&#xff0c;无数次在年轻人的脑海中回响&#xff0c;尤其是在那些因地域差异而面临教育资源匮乏的年轻人中更为普遍。在中国&#xff0…

NRC-SIM:基于Node-RED的多级多核缓存模拟器

整理自&#xff1a; 《NRC-SIM: A NODE-RED Based Multi-Level, Many-Core Cache Simulator》&#xff0c;由 Ezequiel Trevio 撰写&#xff0c;作为他在德克萨斯大学里奥格兰德河谷分校攻读电气工程硕士学位的部分成果。以下是论文的详细主要内容&#xff1a; 摘要(Abstract…

全网最适合入门的面向对象编程教程:37 Python常用复合数据类型-列表和列表推导式

全网最适合入门的面向对象编程教程&#xff1a;37 Python 常用复合数据类型-列表和列表推导式 摘要&#xff1a; 在 Python 中&#xff0c;列表是一个非常灵活且常用的复合数据类型。它允许存储多个项&#xff0c;这些项可以是任意的数据类型&#xff0c;包括其他列表。列表推…

大话MoE混合专家模型

MoE&#xff08;Mixture of Experts&#xff09;&#xff0c;专家混合&#xff0c;就像是人工智能界的超级团队。想象一下&#xff0c;每个专家都有自己的拿手好戏&#xff0c;比如医疗问题找医生&#xff0c;汽车故障找机械师&#xff0c;做饭找大厨。MoE也是这样&#xff0c;…

【前端面试】操作系统

进程与线程 进程线程定义是计算机中的程序关于某数据集合上的一次运行活动&#xff0c;是系统进行资源分配和调度的基本单位是进程中的一个实体&#xff0c;是CPU调度和分派的基本单位&#xff0c;共享进程的资源资源分配拥有独立的内存空间和系统资源共享进程的内存和资源开销…

【Harmony OS 4.0】像素单位 - px、vp、fp

1. px 物理像素&#xff0c;以像素个数来定义图像尺寸。弊端是&#xff0c;在不同像素密度的屏幕上&#xff0c;相同的像素个数对应的物理尺寸是不同的。就会导致我们的应用在不同设备上显示的尺寸可能不同。如下图&#xff1a; 2. vp(Virtual Pixel) 虚拟像素是一种可根据屏幕…