如何具备阅读JAVA JDK虚拟机源码能力

news2024/10/27 17:18:03

源码位置https://github.com/openjdk/jdk

核心实现源码[部分截图]

图片

/* * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.  Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */

/* * This file contains the main entry point into the launcher code * this is the only file which will be repeatedly compiled by other * tools. The rest of the files will be linked in. */
#include "defines.h"#include "jli_util.h"#include "jni.h"
/* * Entry point. */#ifdef JAVAW
char **__initenv;
int WINAPIWinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow){    int margc;    char** margv;    int jargc;    char** jargv;    const jboolean const_javaw = JNI_TRUE;
    __initenv = _environ;
#else /* JAVAW */JNIEXPORT intmain(int argc, char **argv){    int margc;    char** margv;    int jargc;    char** jargv;    const jboolean const_javaw = JNI_FALSE;#endif /* JAVAW */    {        int i, main_jargc, extra_jargc;        JLI_List list;
        main_jargc = (sizeof(const_jargs) / sizeof(char *)) > 1            ? sizeof(const_jargs) / sizeof(char *)            : 0; // ignore the null terminator index
        extra_jargc = (sizeof(const_extra_jargs) / sizeof(char *)) > 1            ? sizeof(const_extra_jargs) / sizeof(char *)            : 0; // ignore the null terminator index
        if (main_jargc > 0 && extra_jargc > 0) { // combine extra java args            jargc = main_jargc + extra_jargc;            list = JLI_List_new(jargc + 1);
            for (i = 0 ; i < extra_jargc; i++) {                JLI_List_add(list, JLI_StringDup(const_extra_jargs[i]));            }
            for (i = 0 ; i < main_jargc ; i++) {                JLI_List_add(list, JLI_StringDup(const_jargs[i]));            }
            // terminate the list            JLI_List_add(list, NULL);            jargv = list->elements;         } else if (extra_jargc > 0) { // should never happen            fprintf(stderr, "EXTRA_JAVA_ARGS defined without JAVA_ARGS");            abort();         } else { // no extra args, business as usual            jargc = main_jargc;            jargv = (char **) const_jargs;         }    }
    JLI_InitArgProcessing(jargc > 0, const_disable_argfile);
#ifdef _WIN32    {        int i = 0;        if (getenv(JLDEBUG_ENV_ENTRY) != NULL) {            printf("Windows original main args:\n");            for (i = 0 ; i < __argc ; i++) {                printf("wwwd_args[%d] = %s\n", i, __argv[i]);            }        }    }
    // Obtain the command line in UTF-16, then convert it to ANSI code page    // without the "best-fit" option    LPWSTR wcCmdline = GetCommandLineW();    int mbSize = WideCharToMultiByte(CP_ACP,        WC_NO_BEST_FIT_CHARS | WC_COMPOSITECHECK | WC_DEFAULTCHAR,        wcCmdline, -1, NULL, 0, NULL, NULL);    // If the call to WideCharToMultiByte() fails, it returns 0, which    // will then make the following JLI_MemAlloc() to issue exit(1)    LPSTR mbCmdline = JLI_MemAlloc(mbSize);    if (WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS | WC_COMPOSITECHECK | WC_DEFAULTCHAR,        wcCmdline, -1, mbCmdline, mbSize, NULL, NULL) == 0) {        perror("command line encoding conversion failure");        exit(1);    }
    JLI_CmdToArgs(mbCmdline);    JLI_MemFree(mbCmdline);
    margc = JLI_GetStdArgc();    // add one more to mark the end    margv = (char **)JLI_MemAlloc((margc + 1) * (sizeof(char *)));    {        int i = 0;        StdArg *stdargs = JLI_GetStdArgs();        for (i = 0 ; i < margc ; i++) {            margv[i] = stdargs[i].arg;        }        margv[i] = NULL;    }#else /* *NIXES */    {        // accommodate the NULL at the end        JLI_List args = JLI_List_new(argc + 1);        int i = 0;
        // Add first arg, which is the app name        JLI_List_add(args, JLI_StringDup(argv[0]));        // Append JDK_JAVA_OPTIONS        if (JLI_AddArgsFromEnvVar(args, JDK_JAVA_OPTIONS)) {            // JLI_SetTraceLauncher is not called yet            // Show _JAVA_OPTIONS content along with JDK_JAVA_OPTIONS to aid diagnosis            if (getenv(JLDEBUG_ENV_ENTRY)) {                char *tmp = getenv("_JAVA_OPTIONS");                if (NULL != tmp) {                    JLI_ReportMessage(ARG_INFO_ENVVAR, "_JAVA_OPTIONS", tmp);                }            }        }        // Iterate the rest of command line        for (i = 1; i < argc; i++) {            JLI_List argsInFile = JLI_PreprocessArg(argv[i], JNI_TRUE);            if (NULL == argsInFile) {                JLI_List_add(args, JLI_StringDup(argv[i]));            } else {                int cnt, idx;                cnt = argsInFile->size;                for (idx = 0; idx < cnt; idx++) {                    JLI_List_add(args, argsInFile->elements[idx]);                }                // Shallow free, we reuse the string to avoid copy                JLI_MemFree(argsInFile->elements);                JLI_MemFree(argsInFile);            }        }        margc = args->size;        // add the NULL pointer at argv[argc]        JLI_List_add(args, NULL);        margv = args->elements;    }#endif /* WIN32 */    return JLI_Launch(margc, margv,                   jargc, (const char**) jargv,                   0, NULL,                   VERSION_STRING,                   DOT_VERSION,                   (const_progname != NULL) ? const_progname : *margv,                   (const_launcher != NULL) ? const_launcher : *margv,                   jargc > 0,                   const_cpwildcard, const_javaw, 0);}

图片

intCallJavaMainInNewThread(jlong stack_size, void* args) {    int rslt;    pthread_t tid;    pthread_attr_t attr;    pthread_attr_init(&attr);    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);    size_t adjusted_stack_size;
    if (stack_size > 0) {        if (pthread_attr_setstacksize(&attr, stack_size) == EINVAL) {            // System may require stack size to be multiple of page size            // Retry with adjusted value            adjusted_stack_size = adjustStackSize(stack_size);            if (adjusted_stack_size != (size_t) stack_size) {                pthread_attr_setstacksize(&attr, adjusted_stack_size);            }        }    }    pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads
    if (pthread_create(&tid, &attr, ThreadJavaMain, args) == 0) {        void* tmp;        pthread_join(tid, &tmp);        rslt = (int)(intptr_t)tmp;    } else {       /*        * Continue execution in current thread if for some reason (e.g. out of        * memory/LWP)  a new thread can't be created. This will likely fail        * later in JavaMain as JNI_CreateJavaVM needs to create quite a        * few new threads, anyway, just give it a try..        */        rslt = JavaMain(args);    }
    pthread_attr_destroy(&attr);    return rslt;}
## Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.## This code is free software; you can redistribute it and/or modify it# under the terms of the GNU General Public License version 2 only, as# published by the Free Software Foundation.## This code is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License# version 2 for more details (a copy is included in the LICENSE file that# accompanied this code).## You should have received a copy of the GNU General Public License version# 2 along with this work; if not, write to the Free Software Foundation,# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.## Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA# or visit www.oracle.com if you need additional information or have any# questions.#
#include "defs.S.inc"
        # NOTE WELL!  The _Copy functions are called directly        # from server-compiler-generated code via CallLeafNoFP,        # which means that they *must* either not use floating        # point or use it in the same manner as does the server        # compiler.
        .text
        .align 16DECLARE_FUNC(SpinPause):        rep        nop        movq   $1, %rax        ret
        # Support for void Copy::arrayof_conjoint_bytes(void* from,        #                                               void* to,        #                                               size_t count)        # rdi - from        # rsi - to        # rdx - count, treated as ssize_t        #        .p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_bytes):        movq     %rdx,%r8             # byte count        shrq     $3,%rdx              # qword count        cmpq     %rdi,%rsi        leaq     -1(%rdi,%r8,1),%rax  # from + bcount*1 - 1        jbe      acb_CopyRight        cmpq     %rax,%rsi        jbe      acb_CopyLeftacb_CopyRight:        leaq     -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8        leaq     -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8        negq     %rdx        jmp      7f        .p2align 4,,151:      movq     8(%rax,%rdx,8),%rsi        movq     %rsi,8(%rcx,%rdx,8)        addq     $1,%rdx        jnz      1b2:      testq    $4,%r8               # check for trailing dword        jz       3f        movl     8(%rax),%esi         # copy trailing dword        movl     %esi,8(%rcx)        addq     $4,%rax        addq     $4,%rcx              # original %rsi is trashed, so we                                      #  can't use it as a base register3:      testq    $2,%r8               # check for trailing word        jz       4f        movw     8(%rax),%si          # copy trailing word        movw     %si,8(%rcx)        addq     $2,%rcx4:      testq    $1,%r8               # check for trailing byte        jz       5f        movb     -1(%rdi,%r8,1),%al   # copy trailing byte        movb     %al,8(%rcx)5:      ret        .p2align 4,,156:      movq     -24(%rax,%rdx,8),%rsi        movq     %rsi,-24(%rcx,%rdx,8)        movq     -16(%rax,%rdx,8),%rsi        movq     %rsi,-16(%rcx,%rdx,8)        movq     -8(%rax,%rdx,8),%rsi        movq     %rsi,-8(%rcx,%rdx,8)        movq     (%rax,%rdx,8),%rsi        movq     %rsi,(%rcx,%rdx,8)7:      addq     $4,%rdx        jle      6b        subq     $4,%rdx        jl       1b        jmp      2bacb_CopyLeft:        testq    $1,%r8               # check for trailing byte        jz       1f        movb     -1(%rdi,%r8,1),%cl   # copy trailing byte        movb     %cl,-1(%rsi,%r8,1)        subq     $1,%r8               # adjust for possible trailing word1:      testq    $2,%r8               # check for trailing word        jz       2f        movw     -2(%rdi,%r8,1),%cx   # copy trailing word        movw     %cx,-2(%rsi,%r8,1)2:      testq    $4,%r8               # check for trailing dword        jz       5f        movl     (%rdi,%rdx,8),%ecx   # copy trailing dword        movl     %ecx,(%rsi,%rdx,8)        jmp      5f        .p2align 4,,153:      movq     -8(%rdi,%rdx,8),%rcx        movq     %rcx,-8(%rsi,%rdx,8)        subq     $1,%rdx        jnz      3b        ret        .p2align 4,,154:      movq     24(%rdi,%rdx,8),%rcx        movq     %rcx,24(%rsi,%rdx,8)        movq     16(%rdi,%rdx,8),%rcx        movq     %rcx,16(%rsi,%rdx,8)        movq     8(%rdi,%rdx,8),%rcx        movq     %rcx,8(%rsi,%rdx,8)        movq     (%rdi,%rdx,8),%rcx        movq     %rcx,(%rsi,%rdx,8)5:      subq     $4,%rdx        jge      4b        addq     $4,%rdx        jg       3b        ret
        # Support for void Copy::arrayof_conjoint_jshorts(void* from,        #                                                 void* to,        #                                                 size_t count)        # Equivalent to        #   conjoint_jshorts_atomic        #        # If 'from' and/or 'to' are aligned on 4- or 2-byte boundaries, we        # let the hardware handle it.  The tow or four words within dwords        # or qwords that span cache line boundaries will still be loaded        # and stored atomically.        #        # rdi - from        # rsi - to        # rdx - count, treated as ssize_t        #        .p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_jshorts):DECLARE_FUNC(_Copy_conjoint_jshorts_atomic):        movq     %rdx,%r8             # word count        shrq     $2,%rdx              # qword count        cmpq     %rdi,%rsi        leaq     -2(%rdi,%r8,2),%rax  # from + wcount*2 - 2        jbe      acs_CopyRight        cmpq     %rax,%rsi        jbe      acs_CopyLeftacs_CopyRight:        leaq     -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8        leaq     -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8        negq     %rdx        jmp      6f1:      movq     8(%rax,%rdx,8),%rsi        movq     %rsi,8(%rcx,%rdx,8)        addq     $1,%rdx        jnz      1b2:      testq    $2,%r8               # check for trailing dword        jz       3f        movl     8(%rax),%esi         # copy trailing dword        movl     %esi,8(%rcx)        addq     $4,%rcx              # original %rsi is trashed, so we                                      #  can't use it as a base register3:      testq    $1,%r8               # check for trailing word        jz       4f        movw     -2(%rdi,%r8,2),%si   # copy trailing word        movw     %si,8(%rcx)4:      ret        .p2align 4,,155:      movq     -24(%rax,%rdx,8),%rsi        movq     %rsi,-24(%rcx,%rdx,8)        movq     -16(%rax,%rdx,8),%rsi        movq     %rsi,-16(%rcx,%rdx,8)        movq     -8(%rax,%rdx,8),%rsi        movq     %rsi,-8(%rcx,%rdx,8)        movq     (%rax,%rdx,8),%rsi        movq     %rsi,(%rcx,%rdx,8)6:      addq     $4,%rdx        jle      5b        subq     $4,%rdx        jl       1b        jmp      2bacs_CopyLeft:        testq    $1,%r8               # check for trailing word        jz       1f        movw     -2(%rdi,%r8,2),%cx   # copy trailing word        movw     %cx,-2(%rsi,%r8,2)1:      testq    $2,%r8               # check for trailing dword        jz       4f        movl     (%rdi,%rdx,8),%ecx   # copy trailing dword        movl     %ecx,(%rsi,%rdx,8)        jmp      4f2:      movq     -8(%rdi,%rdx,8),%rcx        movq     %rcx,-8(%rsi,%rdx,8)        subq     $1,%rdx        jnz      2b        ret        .p2align 4,,153:      movq     24(%rdi,%rdx,8),%rcx        movq     %rcx,24(%rsi,%rdx,8)        movq     16(%rdi,%rdx,8),%rcx        movq     %rcx,16(%rsi,%rdx,8)        movq     8(%rdi,%rdx,8),%rcx        movq     %rcx,8(%rsi,%rdx,8)        movq     (%rdi,%rdx,8),%rcx        movq     %rcx,(%rsi,%rdx,8)4:      subq     $4,%rdx        jge      3b        addq     $4,%rdx        jg       2b        ret
        # Support for void Copy::arrayof_conjoint_jints(jint* from,        #                                               jint* to,        #                                               size_t count)        # Equivalent to        #   conjoint_jints_atomic        #        # If 'from' and/or 'to' are aligned on 4-byte boundaries, we let        # the hardware handle it.  The two dwords within qwords that span        # cache line boundaries will still be loaded and stored atomically.        #        # rdi - from        # rsi - to        # rdx - count, treated as ssize_t        #        .p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_jints):DECLARE_FUNC(_Copy_conjoint_jints_atomic):        movq     %rdx,%r8             # dword count        shrq     %rdx                 # qword count        cmpq     %rdi,%rsi        leaq     -4(%rdi,%r8,4),%rax  # from + dcount*4 - 4        jbe      aci_CopyRight        cmpq     %rax,%rsi        jbe      aci_CopyLeftaci_CopyRight:        leaq     -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8        leaq     -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8        negq     %rdx        jmp      5f        .p2align 4,,151:      movq     8(%rax,%rdx,8),%rsi        movq     %rsi,8(%rcx,%rdx,8)        addq     $1,%rdx        jnz       1b2:      testq    $1,%r8               # check for trailing dword        jz       3f        movl     8(%rax),%esi         # copy trailing dword        movl     %esi,8(%rcx)3:      ret        .p2align 4,,154:      movq     -24(%rax,%rdx,8),%rsi        movq     %rsi,-24(%rcx,%rdx,8)        movq     -16(%rax,%rdx,8),%rsi        movq     %rsi,-16(%rcx,%rdx,8)        movq     -8(%rax,%rdx,8),%rsi        movq     %rsi,-8(%rcx,%rdx,8)        movq     (%rax,%rdx,8),%rsi        movq     %rsi,(%rcx,%rdx,8)5:      addq     $4,%rdx        jle      4b        subq     $4,%rdx        jl       1b        jmp      2baci_CopyLeft:        testq    $1,%r8               # check for trailing dword        jz       3f        movl     -4(%rdi,%r8,4),%ecx  # copy trailing dword        movl     %ecx,-4(%rsi,%r8,4)        jmp      3f1:      movq     -8(%rdi,%rdx,8),%rcx        movq     %rcx,-8(%rsi,%rdx,8)        subq     $1,%rdx        jnz      1b        ret        .p2align 4,,152:      movq     24(%rdi,%rdx,8),%rcx        movq     %rcx,24(%rsi,%rdx,8)        movq     16(%rdi,%rdx,8),%rcx        movq     %rcx,16(%rsi,%rdx,8)        movq     8(%rdi,%rdx,8),%rcx        movq     %rcx,8(%rsi,%rdx,8)        movq     (%rdi,%rdx,8),%rcx        movq     %rcx,(%rsi,%rdx,8)3:      subq     $4,%rdx        jge      2b        addq     $4,%rdx        jg       1b        ret
        # Support for void Copy::arrayof_conjoint_jlongs(jlong* from,        #                                                jlong* to,        #                                                size_t count)        # Equivalent to        #   conjoint_jlongs_atomic        #   arrayof_conjoint_oops        #   conjoint_oops_atomic        #        # rdi - from        # rsi - to        # rdx - count, treated as ssize_t        #        .p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_jlongs):DECLARE_FUNC(_Copy_conjoint_jlongs_atomic):        cmpq     %rdi,%rsi        leaq     -8(%rdi,%rdx,8),%rax # from + count*8 - 8        jbe      acl_CopyRight        cmpq     %rax,%rsi        jbe      acl_CopyLeftacl_CopyRight:        leaq     -8(%rsi,%rdx,8),%rcx # to + count*8 - 8        negq     %rdx        jmp      3f1:      movq     8(%rax,%rdx,8),%rsi        movq     %rsi,8(%rcx,%rdx,8)        addq     $1,%rdx        jnz      1b        ret        .p2align 4,,152:      movq     -24(%rax,%rdx,8),%rsi        movq     %rsi,-24(%rcx,%rdx,8)        movq     -16(%rax,%rdx,8),%rsi        movq     %rsi,-16(%rcx,%rdx,8)        movq     -8(%rax,%rdx,8),%rsi        movq     %rsi,-8(%rcx,%rdx,8)        movq     (%rax,%rdx,8),%rsi        movq     %rsi,(%rcx,%rdx,8)3:      addq     $4,%rdx        jle      2b        subq     $4,%rdx        jl       1b        ret4:      movq     -8(%rdi,%rdx,8),%rcx        movq     %rcx,-8(%rsi,%rdx,8)        subq     $1,%rdx        jnz      4b        ret        .p2align 4,,155:      movq     24(%rdi,%rdx,8),%rcx        movq     %rcx,24(%rsi,%rdx,8)        movq     16(%rdi,%rdx,8),%rcx        movq     %rcx,16(%rsi,%rdx,8)        movq     8(%rdi,%rdx,8),%rcx        movq     %rcx,8(%rsi,%rdx,8)        movq     (%rdi,%rdx,8),%rcx        movq     %rcx,(%rsi,%rdx,8)acl_CopyLeft:        subq     $4,%rdx        jge      5b        addq     $4,%rdx        jg       4b        ret

图片

图片

JAVA JDK的源码是C,C++,ASM实现,其中编译原理,算法,数据结构,JIT等技术点知识已经融入到代码里。

图片

图片

图片

图片

通过学习《程序员内功修炼》《编译器实现》《github c语言大型开源项目源码吸收转化实践》这3门课程足以。

图片

图片

https://beifengisnil.github.io/

talk is cheap, show me the code

这个code里面欧美程序员已经将编译原理,算法,数据结构,操作系统,数学,工程,AI等不计其数的知识体系已经融入实现到代码里,并且持续用了几十年,这些code是面向全球用户市场的,且具有强大的技术经济价值,创新能力,市场开发能力,这几十年的编译原理,算法,数学,工程,AI等知识早就code等着你去吸收转化。

code已经给你show了,就看你有没有一套系统的方法去吸收,这3门课程主要传授的是一套系统的方法去获取和运用各种技术知识,而不是教你一门技术,技术是会过时的。

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

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

相关文章

《欢乐饭米粒儿》持续热播:第四期小品笑中有思,引发观众共鸣

由鲜博士独家冠名播出的独创小品剧《欢乐饭米粒儿》第九季自播出以来&#xff0c;便以其贴近生活的题材和幽默风趣的表演赢得了观众的喜爱。每个小品不仅让人捧腹大笑&#xff0c;更在笑声中传递了深刻的生活哲理。近日&#xff0c;《欢乐饭米粒儿》又带来了几个新的小品&#…

计算机视觉专栏(1)【LeNet】论文详解

Lenet 系列 论文精讲部分0.摘要1.引言2.CNN3.结果分析4.总结 论文精讲部分 本专栏旨在深入解析计算机视觉模型的论文及其发展背景&#xff0c;并通过代码部分的实际实验来加深理解。读者可以根据自己的需要参考其中的内容。其主体为原文&#xff0c;笔者理解内容会采用引用格式…

一站式学习 Shell 脚本语法与编程技巧,踏出自动化的第一步

文章目录 1. 初识 Shell 解释器1.1 Shell 类型1.2 Shell 的父子关系 2. 编写第一个 Shell 脚本3. Shell 脚本语法3.1 脚本格式3.2 注释3.2.1 单行注释3.2.2 多行注释 3.3 Shell 变量3.3.1 系统预定义变量&#xff08;环境变量&#xff09;printenv 查看所有环境变量set 查看所有…

HTML3D旋转相册

文章目录 序号目录1HTML满屏跳动的爱心(可写字)2HTML五彩缤纷的爱心3HTML满屏漂浮爱心4HTML情人节快乐

[Ansible实践笔记]自动化运维工具Ansible(一):初探ansibleansible的点对点模式

文章目录 Ansible介绍核心组件任务执行方式 实验前的准备更新拓展安装包仓库在ansible主机上配置ip与主机名的对应关系生成密钥对将公钥发送到被管理端&#xff0c;实现免密登录测试一下是否实现免密登录 常用工具ansibleansible—docansible—playbook 主要配置文件 Ansible 模…

centeros7 编译ffmpeg

使用yum安装的路似乎已经堵住了&#xff0c;请求的镜像全是404或503 1.打开终端并使用yum安装EPEL存储库(Extra Packages for Enterprise Linux)&#xff1a;sudo yum install epel-release2.接下来&#xff0c;使用以下命令来安装FFmpeg&#xff1a;sudo yum install ffmpeg …

uniApp 加载google地图 并规划路线

uniApp 加载google地图 并规划路线 备注:核心代码实例 备注: 打开谷歌地图失败的话 参考google开发文档 https://developers.google.com/maps/documentation/urls/ios-urlscheme?hlzh-cn#swift核心代码 mounted() {this.loadGoogleMapsScript(); }, methods: {//加载loadGo…

使用 Docker 管理完整项目:Java、Vue、Redis 和 Nginx 的一站式部署

个人名片 🎓作者简介:java领域优质创作者 🌐个人主页:码农阿豪 📞工作室:新空间代码工作室(提供各种软件服务) 💌个人邮箱:[2435024119@qq.com] 📱个人微信:15279484656 🌐个人导航网站:www.forff.top 💡座右铭:总有人要赢。为什么不能是我呢? 专栏导…

完美解决phpstudy安装后mysql无法启动

phpstudy数据库无法启动有以下几个原因。 一、自己在电脑上安装了MySQL数据库,MySQL的服务名为MySQL,这会与phpstudy的数据库的服务名发生冲突&#xff0c;从而造成phpstudy中的数据库无法启动&#xff0c;这时我们只需要将自己安装的MySQL的服务名改掉就行。 但是&#xff0…

使用 NumPy 和 Matplotlib 进行高级数据可视化:实践指南

使用 NumPy 和 Matplotlib 进行高级数据可视化&#xff1a;实践指南 数据科学和工程实践中&#xff0c;NumPy 和 Matplotlib 是强大的组合工具。本文将进一步展示如何借助这两个库进行更复杂的可视化任务&#xff0c;例如创建多曲线、叠加图、动态可视化等场景。 一、环境准备…

模型训练识别手写数字(三)

1. 使用卷积神经网络&#xff08;CNN&#xff09;来构建模型训练 import numpy as np from keras import Sequential from keras.api.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout, BatchNormalization from keras.src.legacy.preprocessing.image import Im…

Date工具类详细汇总-Date日期相关方法

# 1024程序员节 | 征文 # 目录 简介 Date工具类单元测试 Date工具类 简介 本文章是个人总结实际工作中常用到的Date工具类&#xff0c;主要包含Java-jdk8以下版本的Date相关使用方法&#xff0c;可以方便的在工作中灵活的应用&#xff0c;在个人工作期间频繁使用这些时间的格…

力扣 中等 740.删除并获得点数

文章目录 题目介绍题解 题目介绍 题解 由题意可知&#xff0c;在选择了数组中元素 a 后&#xff0c;该元素以及所有等于 a−1 和 a1 的元素都会从数组中删去&#xff0c;并获得 a 的点数。若还有多个值为 a的元素&#xff0c;由于所有等于 a−1 或 a1 的元素已经被删除&#x…

Linux相关概念和易错知识点(16)(Shell原理、进程属性和环境变量表的联系)

Shell原理及其模拟实现 在认识进程exec系列函数、命令行参数列表、环境变量之后&#xff0c;我们可以尝试理解一下Shell的原理&#xff0c;将各方知识串联起来&#xff0c;让Shell跑起来才能真正理解这些概念。我会以模拟Shell执行的原理模拟一个Shell。途中配上相关讲解。 1…

信息安全工程师(72)网络安全风险评估概述

前言 网络安全风险评估是一项重要的技术任务&#xff0c;它涉及对网络系统、信息系统和网络基础设施的全面评估&#xff0c;以确定存在的安全风险和威胁&#xff0c;并量化其潜在影响以及可能的发生频率。 一、定义与目的 网络安全风险评估是指对网络系统中存在的潜在威胁和风险…

《Python游戏编程入门》注-第3章3

《Python游戏编程入门》的“3.2.4 Mad Lib”中介绍了一个名为“Mad Lib”游戏的编写方法。 1 游戏玩法 “Mad Lib”游戏由玩家根据提示输入一些信息&#xff0c;例如男人姓名、女人姓名、喜欢的食物以及太空船的名字等。游戏根据玩家输入的信息编写出一个故事&#xff0c;如图…

基于SSM的汽车客运站管理系统【附源码】

基于SSM的汽车客运站管理系统&#xff08;源码L文说明文档&#xff09; 目录 4 系统设计 4.1 设计原则 4.2 功能结构设计 4.3 数据库设计 4.3.1 数据库概念设计 4.3.2 数据库物理设计 5 系统实现 5.1 管理员功能实现 5.1.1 管理员信息 5.1.2 车…

详细解读Movie Gen(2):个性化视频训练

Diffusion Models专栏文章汇总:入门与实战 前言:Meta最近重磅发布了视频生成30B的基础模型Movie Gen,长达93页的技术报告中干货满满,博主将详细解读Movie Gen的核心网络结构、个性化视频微调方法、视频编辑等方面。虽然大部分人没有直接预训练30B模型的机会,但是可以从中获…

C++游戏开发中的多线程处理是否真的能够显著提高游戏性能?如果多个线程同时访问同一资源,会发生什么?如何避免数据竞争?|多线程|游戏开发|性能优化

目录 1. 多线程处理的基本概念 1.1 多线程的定义 1.2 线程的创建与管理 2. 多线程在游戏开发中的应用 2.1 渲染与物理计算 3. 多线程处理的性能提升 3.1 性能评估 3.2 任务分配策略 4. 多线程中的数据竞争 4.1 数据竞争的定义 4.2 多线程访问同一资源的后果 4.3 避…

视频剪辑新手必备:四款热门电脑视频剪辑软件评测

现在真的是一个视频流量的时代&#xff0c;不得不说&#xff0c;我都已经开始刷视频小说了&#xff01;如果你和我一样&#xff0c;是个对电脑视频剪辑充满好奇的新手&#xff0c;那么你一定想知道哪款软件最适合我们这些初学者。今天&#xff0c;我就来和大家分享一下我使用过…